I understand that to use scheduled syncs, scrubs and diffs I should set up scheduled jobs in OMV GUI to execute related scripts.
I could not find any reference how this should be done. What are the commands that should be called?
I understand that to use scheduled syncs, scrubs and diffs I should set up scheduled jobs in OMV GUI to execute related scripts.
I could not find any reference how this should be done. What are the commands that should be called?
Nevermind i found the "scheduled diff" button under the Snapraid module page.
Can anyone explain what
does in the provided scripts?
Second question:
What exactly happens when i exclude specific dirs in the Snapraid rules section?
I guess these files/dirs are excluded from all sync/scrub/diff and other jobs?
Does this setting only work if i use the OMV provided scripts or will it also work with the external scripts referenced in this thread?
Thanks.
Ok, so it would make sense to run a sync and scrub every 2 days with 5% of the array and a scrub_age=40.
So after the script ran 20 times it scanned 100% of the array in 40 days.
What exactly happens when i exclude specific dirs in the Snapraid rules section?
I guess these files/dirs are excluded from all sync/scrub/diff and other jobs?
Does this setting only work if i use the OMV provided scripts or will it also work with the external scripts referenced in this thread?
To answer for anyone that wants to know: this should work independantly from any scripts as it is added to general snapraid.conf
Great job on the snapraid plugin ryecoaaron and the snapraid diff script Solo0815 !
I was just about to create a manual scheduled job until I saw the awesome report functions inside the snapraid diff script.
I just feel like the "SCRUB_OLDER_THAN_DAYS" variable is essential and should be implemented into the pluging ASAP
So use another script. There are several available that have the capability you seek.
So use another script. There are several available that have the capability you seek.
It is in the script, just not in the plugin.
Of course I can change it in the script manually, but then I don't know if it will survive the next update to the plugin.
The cleanest way would be to set it in the snapraid-diff.conf but here it states:
# This file is auto-generated by openmediavault (https://www.openmediavault.org)
# WARNING: Do not edit this file, your changes will get lost.
...
So it would be a lot nicer if it was possible to set this variable from the plugin.
It is in the script, just not in the plugin.
Of course I can change it in the script manually, but then I don't know if it will survive the next update to the plugin.
The cleanest way would be to set it in the snapraid-diff.conf but here it states:
Code: snapraid-diff.conf# This file is auto-generated by openmediavault (https://www.openmediavault.org) # WARNING: Do not edit this file, your changes will get lost. ...
So it would be a lot nicer if it was possible to set this variable from the plugin.
As I said. Use another script and stop using this one.
As I said. Use another script and stop using this one.
It was meant as a suggestion not a complaint.
The variable is already there, just not actively implemented.
(...)Display MoreIf you're not doing a SYNC manually, on a regular basis, you might think about automating a SYNC command to run once or twice a month. It can be done in scheduled tasks with something like the follow command: snapraid touch; snapraid sync -l snapsync.log
But note there are other housekeeping commands you should consider running, before running the next SYNC command.
The order I run is:
snapraid touch; snapraid sync -l snapsync.log
snapraid -p 100 -o 13 scrub
snapraid -e fix
(...)
That's how I do it. Others may have other ideas.
I quite like that approach it is more or less the best use case for me as well. After setting up the scheduled tasks I am running into the following error sent by email:
/bin/sh: 1: Syntax error: Unterminated quoted string
I am not sure why the cronjob with the scrub command couldn't been executed due to a syntax error. What do I have to adjust or where can I look? In the system logs I did not find anything under snapraid.
If I do a manual run within the GUI, everything completes just fine.
Have you tried creating a new scheduled job? (And deleting the old one.)
Also, maybe hand type it versus copy and paste. An extraneous invisible character or symbol might be present.
I did handtype it from the very first time, too. There is a space after ";" in the forst command between "snapraid touch; snapraid sync" correct?
I did set it up again, let's see what happens next time. Meanwhile I did successfully finish it with a manual run.
There is a space after ";" in the forst command between "snapraid touch; snapraid sync" correct?
Yes, there's a space. (Sorry about the delayed response.)
auanasgheps Thanks for this script! I have been looking for a way to automate SnapRAID in OMV5.
I downloaded your script on my PC (Win10) and would like to customize and deploy it to my OMV5 installation. Could you provide more detailed steps on how to achieve that? I know that I can very likely customize it using Notepad++, but I have absolutely zero clue how to deploy it to OMV and schedule it. As you can tell, my experience with Linux is limited, but I can make things work with some guidance. Any help is appreciated. Thanks!
auanasgheps Thanks for this script! I have been looking for a way to automate SnapRAID in OMV5.
I downloaded your script on my PC (Win10) and would like to customize and deploy it to my OMV5 installation. Could you provide more detailed steps on how to achieve that? I know that I can very likely customize it using Notepad++, but I have absolutely zero clue how to deploy it to OMV and schedule it. As you can tell, my experience with Linux is limited, but I can make things work with some guidance. Any help is appreciated. Thanks!
Hi!
Extract the ZIP and use WinSCP to copy the two files from Windows to /usr/sbin/snapraid. There's no snapraid folder in there so create it first.
Then follow my simple instructions in Github.
Making changes it's very easy: every configuration has a description. If you are unsure, don't change it, defaults are pretty good.
To schedule the script (or really anything else),
Don’t have an account yet? Register yourself now and be a part of our community!