How to schedule a cron job twice a day?
To schedule a cron job twice a day, use the following syntax (it will run the task at midnight and midday):
0 0,12 * * * user-name /path/to/command
# | | | | |
# | | | | .---- Every day of the week
# | | | .------- Every month
# | | .---------- Every day
# | .-------------- When hours equal zero or twelve (, = list separator)
# .------------------ When minutes equal 0
To schedule a cron job twice a day, use the following syntax (it will run the task at midnight and midday):
0 0,12 * * * user-name /path/to/command
# | | | | |
# | | | | .---- Every day of the week
# | | | .------- Every month
# | | .---------- Every day
# | .-------------- When hours equal zero or twelve (, = list separator)
# .------------------ When minutes equal 0
To schedule a cron job twice a day, use the following syntax (it will run the task at midnight and midday) :
0 0,12 * * * user-name /path/to/command
# | | | | |
# | | | | .---- Every day of the week
# | | | .------- Every month
# | | .---------- Every day
# | .-------------- When hours equal zero or twelve (, = list separator)
# .------------------ When minutes equal 0
| # | ID | Query | URL | Count |
|---|---|---|---|---|
| 0 | 13675 | alphons | https://en.ans.wiki/462/how-to-schedule-a-cron-job-twice-a-day | 1 |
| 1 | 11787 | en | https://en.ans.wiki/462/how-to-schedule-a-cron-job-twice-a-day | 8 |