Task jobs no longer allow days >15

Status
Not open for further replies.

JohnKnee

Dabbler
Joined
Aug 24, 2011
Messages
43
I tried to setup up some new CRON jobs after updating to FreeNAS-9.10.2 (a476f16). My system has been running fine otherwise. I have noticed and tried both with Firefox 50.1.0 as well as Edge to move the slider for Every N day of the month but it will only go up until 15. All the other task features work. This behavior also occurs whilst trying to schedule other jobs such as rsync and smart tests. I am not sure if this is limited to my system only or it's a real bug. Screenshot below. The help icon says values between 1-31 are allowed.

upload_2016-12-25_11-28-52.png


Is anyone seeing similar problems? thanks
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,996
Well I had to think about it for a few seconds but the FreeNAS software is working fine. The help note is really for the second tab.

Think about it this way, the slider is for how often you want the event to occur, lets take the Day of month / Every N day of the month per your example. So if I select every 15 days in a month that would be a maximum of 2 times a month, a value of 16 or greater would mean once a month. If you want to select specific days of the month then you need to use the second tab.

You are too close to the machine or drinking too much egg nog. Take a break and re-group.

Merry Christmas!
 

JohnKnee

Dabbler
Joined
Aug 24, 2011
Messages
43
@joeschmuck Thanks.

I guess I am a little confused still. I have searched and googled over the last day or so. So let me tell you what I am trying to do. I am manually running SMART tests on my drives using modified @Bidule0hm scripts (which I have tested and works). I have 3 jobs setup up.

1) Run Short Smart Test every 14 days at 4am.
2) Run Long Smart Test every 28 days at 4 am.
3) Email me Smart Report every 15 days.

I can get both 1) and 3) working via the GUI but I can't setup the 2) option no mater what I try (ie. I can only get the scripts to run max every 15 days). I have a screenshot of a Crontab Generator which I am trying to duplicate.

upload_2016-12-28_11-26-23.png


Hence when I saw that the slider only went up to 15 days, I thought it was a bug. Thanks for looking at this, maybe I am still making a mistake somewhere.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,996
So lets look at your CRON Generator, specifically the Days section. Note on the left you have "Every Half Month" listed, that would be the same as 15. The right column looks like the specific days.

So you are trying to get the CRON job to run once every 4 weeks (28 days)

Edit your CRON job to (note that there is a space between each of the five character sets)

Code:
0 1 */28 * *


That would be:
0 = Run on Minute 00
1 = Run on Hour 01
*/28 = Run Every 28 Days
* = Run Every Month
* = Run Every Day of Week

Now this doesn't mean that it will run on the 28th, it will start when you boot the system and run from there. If you change the third value to say "1,*/28" then it will run on the 1st of each month and then on the 28th. I'm pretty sure this is what you are asking for.

Just some friendly advice... I'd change my CRON jobs to run SMART Short tests to daily and the Long test to weekly. Lastly if you have a report to generate then just do it once a month but don't try to make it every 4 weeks because then you end up getting it in the middle of a month and it just slides around because a month is not 4 weeks. My setup is like this: Short test every night at 00:30, Long Test every Sunday at 01:00. I currently do not use a script even though I have written a few of them out there but if something does come up, I'll get notification from FreeNAS.
 

BigDave

FreeNAS Enthusiast
Joined
Oct 6, 2013
Messages
2,479
Rather than trying to schedule by the number of days between tasks, use the entire monthly
calendar so no tasks/scrubs will ever conflict with another on the same day, or at least
be separated by enough time, as to not conflict with each other. I find this easier.
smart-test-sched.JPG
scrub-settings.JPG
 

JohnKnee

Dabbler
Joined
Aug 24, 2011
Messages
43
@joeschmuck Thanks. That is exactly what I wanted. I will also take your advice and do the test more frequently. This will also allow me to do this all via the GUI instead of editing the Cron job via CLI. As for scripts, I have no choice but to use them as Freenas is not able to correctly set the smartctl settings for them.

@BigDave thanks for you input. I prefer the threshold way of scheduling my tasks as sometimes I have my server off especially if I am not using it for extended periods of time.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,996
@BigDave I still am adjusting to your new avatar.
 

BigDave

FreeNAS Enthusiast
Joined
Oct 6, 2013
Messages
2,479
@BigDave I still am adjusting to your new avatar.
I like to change every so often. BTW, In case you don't recognize him,
that's my favorite musician Stevie Ray Vaughan. ;)
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,996
I knew it looked like some country musician :D
 
Status
Not open for further replies.
Top