In a cron expression, what is the difference between 0/1, 1/1 and * ?
3 Answers
It depends on where the terms are located
0/1means starting at 0 every 1.1/1means starting at 1 every 1.*means all possible values.
so
For the minutes, hours, and day of week columns the
0/1and*are equivalent as these are 0 based.For the Day Of Month and Month columns
1/1and*are equivalent as these are 1 based.
- 116,228
In crontab definition, the meaning of the five date/time fields are :
- At which minutes of the hour (so from 0 to 59)
- At which hour of the day (so from 0 to 23)
- At which day of the month (so from 1 to 31)
- At which month of the year (so from 1 to 12 or names - Jan, Feb, ...)
- At which day of the week (so from 0 to 6 or names - Sun, Mon, ...)
A * means from the first to the last element of the range. A n/x means starting at n, at every x values.
In your case, this can be translated by :
- At minutes 0
- Starting at midnight, every hour (which is similar to *)
- Each day of the month
- Starting the first month (January), every month (which is similar to *)
- Each day of the week (for the first *)
The end looks incorrect (? *) as it is in the place of the command. Or in the place of the username & command if taken from a file under /etc/cron.d/ and not from the crontab of a specific user.
- 396
The 0/1 means every 1 min or every mintue and 1/1 means evey month i think,but i m not sure it will work that way for month.
- 71
-
-
-
-
Sure, but can I replace the hour part
0/1by1/1for instance ? Will it mean the same? – sdabet Mar 19 '14 at 12:45 -
/is stepping, explained really well here: http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/index.jsp?topic=/com.ibm.db2.luw.sql.rtn.doc/doc/c0054381.html – NickW Mar 19 '14 at 12:36