Schedule configuration question

Status
Not open for further replies.

sebeksd

Cadet
Joined
Nov 9, 2014
Messages
6
Hi.

I'm using FreeNAS for a while (as home NAS, 1-2 client's).
From the beginning I have a problem with configuring schedules, GUI for that is mystery for me.
So I read some threads about it on this forum (maybe not to carefully) and I set a scrub on my NAS to run every two weeks on Tuesday. Today (Sunday) I was surprised because scrub was ongoing when I wake up...

So I have a request, can someone verify my configuration and explain where I made mistake ?

I'm running "FreeNAS-9.2.1.8-RELEASE-x64 (e625626)"

Here is my configuration:
Screen1.png

Screen2.png


PS:
I think this window should be redesigned or it should get thick guide how to configure it (with examples!).
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
EDIT: Bad Info Deleted. I'm getting too old.
 
Last edited:

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Threshold days between scrubs is 10 which is incorrect. This value is the maximum days between scrubs regardless of the schedule. You should pick something like 15 because with your schedule you are asking for a scrub every 14 days.
I don't think this is how the threshold works. The rest of the window (which I'll agree is pretty busy, though I don't have ideas off the top of my head for how it could be improved and still retain its functionality) schedules the cron job--and though I'm likely missing something, it looks correct to me. The threshold is an argument to the scrub command--if at least that many days haven't passed since the last scrub completed, the scrub won't run.

With the setup you suggest, a scrub will only run every three weeks. Let's suppose the first Tuesday is 11/1, and the scrub runs. Say it takes 8 hours to complete. Next Tuesday, 11/8, the cron job runs, the scrub command is called, it sees that only 6 days and change (less than 15 days) have passed since the last scrub finished, so the scrub isn't run. The following Tuesday, 11/15, the same thing happens--it's been 13 days and change, less than the threshold of 15 days, since the last scrub finished, so it doesn't run. The Tuesday after that, 11/22, it will have been greater than the threshold days since the last scrub, so the scrub runs.

I'd refer you to a manpage, but /usr/local/sbin/scrub is a script developed by iX. I think the key line is here:
Code:
       if [ ${_scrub_diff} -lt ${threshold} ]; then
                # echo "   skipping scrubbing of pool '${pool}':"
                # echo "          last scrubbing is ${_scrub_diff} days ago, threshold is set to ${threshold} days"


@sebeksd, I'm not sure what's going on. Is your system clock set correctly?
 

sebeksd

Cadet
Joined
Nov 9, 2014
Messages
6
Thanks for replays.

I'm not sure what's going on. Is your system clock set correctly?
Time is set correctly.

Here is my crontab line for this task (if this helps):
Code:
00      09      01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31    *       2       root    PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/root/bin" /usr/local/sbin/scrub -t 10 DataDisk0


I've also investigate my emails to check when cron start scrub before and it seems first run was made at 29.10.2014 9:00 and next one (today) 09.11.2014 9:00.

Subject of email is:
Cron <root@SERVER> PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/root/bin" /usr/local/sbin/scrub -t 10 DataDisk0

If there is any other info I could provide please direct me to it and I will post it here asap.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I just checked my configuration. Rather than using the "each selected day of month", and selecting every day, try using "every N day of month" and setting the slider to 1.
 

sebeksd

Cadet
Joined
Nov 9, 2014
Messages
6
Like you suggest I set it to every 1st day of month (yesterday), but I need to wait 1-2 weeks for result :(
 
Status
Not open for further replies.

Similar threads

J
Replies
21
Views
12K
Top