cron cron.d | cron.hourly | crontab -e | examples
don't modify /etc/crontab
create snapin files in /etc/cron.d
or use cron.{hourly.daily.weekly.monthly}
or use crontab -e
Shortcuts for command Command Output
@reboot Run once after reboot
@yearly or @annually 0 0 1 1 * 1st day of the month on the
1st day of the year
@monthly 0 0 1 * * 1st day of the month
@weekly 0 0 * * 0 Run on Sunday at 12:00 am
@daily 0 0 * * * Run every day at 12:00 am
@hourly 0 * * * * Run every hour on the hour
------------
create snapin files in /etc/cron.d
or use cron.{hourly.daily.weekly.monthly}
or use crontab -e
Shortcuts for command Command Output
@reboot Run once after reboot
@yearly or @annually 0 0 1 1 * 1st day of the month on the
1st day of the year
@monthly 0 0 1 * * 1st day of the month
@weekly 0 0 * * 0 Run on Sunday at 12:00 am
@daily 0 0 * * * Run every day at 12:00 am
@hourly 0 * * * * Run every hour on the hour
------------
crontab does not understand "intervals", it only understands "schedule"
valid hours: 0-23 -- valid minutes: 0-59
example #1
30 * * * * your_command
this means "run when the minute of each hour is 30" (would run at: 1:30, 2:30, 3:30, etc)
example #2
*/30 * * * * your_command
this means "run when the minute of each hour is evenly divisible by 30" (would run at: 1:30, 2:00, 2:30, 3:00, etc)
example #3
0,30 * * * * your_command
this means "run when the minute of each hour is 0 or 30" (would run at: 1:30, 2:00, 2:30, 3:00, etc)
it's another way to accomplish the same results as example #2
example #4
19 * * * * your_command
this means "run when the minute of each hour is 19" (would run at: 1:19, 2:19, 3:19, etc)
example #5
*/19 * * * * your_command
this means "run when the minute of each hour is evenly divisible by 19" (would run at: 1:19, 1:38, 1:57, 2:19, 2:38, 2:57 etc)
Comments
Post a Comment