What happens if I use '*' for the minutes value?
Is the command going to be run every minute?
For example:
* 4 * * 0 <command>
|
|
||||
|
|
|
Yes, in your example, the command will run every minute of the 0400 hour on every Sunday. By the way, if you do need something to run every minute, it's likely that you're monitoring something for changes; there is typically a better way of doing this. For instance, on Linux there is |
|||
|
|
|
Yes this will run every minute of the fifth hour (0400 to 0459) on Sunday. Likely what is intended is to run once during that period. Unless it needs to run on the hour, pick a random value from 1 to 59, and replace the minutes value. If you have a bunch of programs that need to run in a particular period, you can limit load peaks by using a random minute in the hour you want the task to run. Use a different value for each crontab entry. |
|||
|
|
|
Yes, this job will run every minute. Here are some relevant sections from man 5 crontab:
The manpage says that if you use the asterisk (*) in the minute field, this is is equivalent to using "0-59" (``first-last''), and the job will run every minute in the hour. |
|||
|
|