Computing desk | ||
---|---|---|
< January 16 | << Dec | January | Feb >> | January 18 > |
Welcome to the Wikipedia Computing Reference Desk Archives |
---|
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages. |
At work, I have to use a .NET scheduler library that uses Unix cron expressions for scheduling. The documentation tells me that "?" means "any day/month" and "*" means "every day/month". What is the difference between these? Could anyone give a concrete example where "?" and "*" cause different schedules? Or do such conditions even exist? JIP | Talk 20:46, 17 January 2016 (UTC)
man 5 crontab
", and this version does have a meaning for "?". It means that when reading the crontab file, cron is to select any one value randomly from the permitted ones. So for example "20 ? * * *
" specifies that the job is to run once a day at 20 minutes past some hour: for example, it might be at 3:20 or 7:20 or 23:20. "? ? * * *
" would run it once a day at a random time. Also, "?" can be followed (without spaces) by a range, which asks for a random selection from that range. "?40-42 * * * *
" would run the job once an hour at either 40, 41, or 42 minutes past the hour.Computing desk | ||
---|---|---|
< January 16 | << Dec | January | Feb >> | January 18 > |
Welcome to the Wikipedia Computing Reference Desk Archives |
---|
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages. |
At work, I have to use a .NET scheduler library that uses Unix cron expressions for scheduling. The documentation tells me that "?" means "any day/month" and "*" means "every day/month". What is the difference between these? Could anyone give a concrete example where "?" and "*" cause different schedules? Or do such conditions even exist? JIP | Talk 20:46, 17 January 2016 (UTC)
man 5 crontab
", and this version does have a meaning for "?". It means that when reading the crontab file, cron is to select any one value randomly from the permitted ones. So for example "20 ? * * *
" specifies that the job is to run once a day at 20 minutes past some hour: for example, it might be at 3:20 or 7:20 or 23:20. "? ? * * *
" would run it once a day at a random time. Also, "?" can be followed (without spaces) by a range, which asks for a random selection from that range. "?40-42 * * * *
" would run the job once an hour at either 40, 41, or 42 minutes past the hour.