Cheatography
https://cheatography.com
Configure and Schedule
Cron job script |
/etc/cron.daily/logroate |
Configuration file |
/etc/logrotate.conf |
Hourly or customized |
a. /etc/cron.hourly b. crontab (see below) |
1. When does cron.daily
run? grep run-parts /etc/crontab
Cron job definition
# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12)
# | | | | .---- day of week (0 - 6) (Sun=0 or 7)
# | | | | |
# * * * * * command to be executed
|
|
|
crontab
list crontab |
crontab -l
// Current user specific |
create crontab |
crontab -e
// Current user specific |
user's crontab file |
// DON'T edit directly CentOS:/var/spool/cron/$user Ubuntu /var/spool/cron/crontabs/$user |
system-wide crontab |
// Username field is required /etc/crontab |
Example (arix-be)
# do daily/weekly/monthly maintenance
# min hour day month weekday command
*/15 * * * * run-parts /etc/periodic/15min
0 * * * * run-parts /etc/periodic/hourly
0 2 * * * run-parts /etc/periodic/daily
0 3 * * 6 run-parts /etc/periodic/weekly
0 5 1 * * run-parts /etc/periodic/monthly
|
Created By
Metadata
Favourited By
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets