Show Menu

Logrotate and Cron Job Cheat Sheet by

linux     cronjob     logroate

Configure and Schedule

Cron job script
/etc/c­ron.da­ily­/lo­groate
Config­uration file
/etc/l­ogr­ota­te.conf
Hourly or customized
a. /etc/c­ron.hourly
b. crontab (see below)
1. When does cron.d­aily run? grep run-parts /etc/c­rontab

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­:/v­ar/­spo­ol/­cro­n/$user
Ubuntu /var/s­poo­l/c­ron­/cr­ont­abs­/$user
system­-wide crontab
// Username field is required
/etc/c­rontab
Example (arix-be)
# do daily/­wee­kly­/mo­nthly mainte­nance
# min hour day month weekday command
*/15 * * * * run-parts /etc/p­eri­odi­c/1­5min
0 * * * * run-parts /etc/p­eri­odi­c/h­ourly
0 2 * * * run-parts /etc/p­eri­odi­c/d­aily
0 3 * * 6 run-parts /etc/p­eri­odi­c/w­eekly
0 5 1 * * run-parts /etc/p­eri­odi­c/m­onthly

Download the Logrotate and Cron Job Cheat Sheet

1 Page
//media.cheatography.com/storage/thumb/architect-handbook_logrotate-and-cron-job.750.jpg

PDF (recommended)

Alternative Downloads

Share This Cheat Sheet!

 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          Linux Command Line Cheat Sheet
          mod_rewrite Cheat Sheet
          Vim NERDTree Cheat Sheet