Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

What happens if I use '*' for the minutes value? Is the command going to be run every minute? For example: * 4 * * 0 <command>

share|improve this question
add comment

3 Answers 3

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 inotify for waking programs based on filesystem events, and ip monitor for watching network status changes.

share|improve this answer
add comment

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.

share|improve this answer
add comment

Yes, this job will run every minute.

Here are some relevant sections from man 5 crontab:

   cron(8) examines cron entries once every minute.  The time and date fields are:

          field          allowed values
          -----          --------------
          minute         0-59
          hour           0-23
          day of month   1-31
          month          1-12 (or names, see below)
          day of week    0-7 (0 or 7 is Sun, or use names)

   A field may be an asterisk (*), which always stands for ``first-last''.

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.