Cron Scheduling

Status
Not open for further replies.

tom__w

Explorer
Joined
Mar 26, 2013
Messages
87
I am EXTREMELY new to Unix / FreeNAS / etc. I will be using the forum extensively to learn more. For now, I have what will be an easy question.

If I want to run a job as follows:

I want to run a job on the 1st and 15th of each month at 1:00PM (regardless of what day it falls on), what check boxes do I select in the GUI? I think I get it and then the interface complains and says I must check the days? (But I don't want to specify the day)

Thanks for helping me with such a stupid question..
:confused:
 

fracai

Guru
Joined
Aug 22, 2012
Messages
1,212
I thought you would be able to leave none checked, but if it's complaining just check all the days of the week. If you've also checked the 1st and 15th, it will still only run on those days.
 

fracai

Guru
Joined
Aug 22, 2012
Messages
1,212
Not if you also set it to run on the 1st and 15th. The selections aren't summed, they're layers of requirements.

So, if you want something to run every other week on Sunday, you can select days 1-7, days 15-21, and Sunday. The task will only run on Sunday, and it won't run on days 8-14 or 22-31. In other words, It'll run on the 1st and 3rd Sundays. You can reach the same result by setting an interval of more than a week and Sunday. My scrub task is set that way and I get an email every week. One week will say "starting scrub", the next will say something like "skipping scrub: threshold not exceeded"

You want days 1 and 15 and whatever day of the week that happens to be. I thought you could just leave the days unchecked, but it's complaining so you need to set at least one day, but you don't care which day of the week it runs on, so select them all. You could also set a 15 day interval if that scheduler option is available (scrub, snapshot, etc., not cron).
 

tom__w

Explorer
Joined
Mar 26, 2013
Messages
87
I did see that quote and it did confuse a little.

So my question still stands: What are the GUI options for scheduling a job to run on the 1st and 15th of the month, regardless of the day? (I think I have the time / hour thing)

These options being the ones in question:
Day of month slider or day selections if use the slider, sync occurs every N days; if use day selections, sync occurs on the highlighted days
Month checkboxes task occurs on the selected months
Day of week checkboxes task occurs on the selected days of the week

- - - Updated - - -

PS - Really hate feeling this stupid but have to learn somehow
 

paleoN

Wizard
Joined
Apr 22, 2012
Messages
1,403
Day of week checkboxes task occurs on the selected days of the week
Don't change this, i.e. all checked. Then set DoM. You can look at crontab to see exactly what was put where:
Code:
cat /etc/crontab
 

fracai

Guru
Joined
Aug 22, 2012
Messages
1,212
"man crontab(5) said:
Note: The day of a command's execution can be specified by two fields --
day of month, and day of week. If both fields are restricted (ie, are
not *), the command will be run when either field matches the current
time.
Which would make DoW & DoM an OR, no? The rest still being ANDs.[/INDENT]
The key part is "are not *". In the case that every day is checked, the DoW field is a star, so it isn't restricted.

Though, thanks for the clarification that the fields aren't exactly ANDed. I was confusing things a bit with the "threshold" field.

- - - Updated - - -

PS - Really hate feeling this stupid but have to learn somehow
We've all been there. I've been using *nix systems for 13 years now and there is still plenty to learn; I'm sure there are loads of users on this board that would still consider me a *nix noob. I certainly still am when it comes to FreeNAS and ZFS. Plus there is plenty that I've forgotten or don't remember exactly.
 
Status
Not open for further replies.
Top