Codxplore.com

Latest news:

Sahih al-Bukhari (সহীহ বুখারী) is a free Hadith application for android. This application is advertisement free. Download now https://play.google.com/store/apps/details?id=com.akramhossin.bukharisharif

Linux Cron Cheat Sheet


Linux Cron Cheat Sheet

Cron is a scheduling system for POSIX computers

Notation

  • Minute Hour Date Month Weekday

Examples

10 * * * * At the 10th minute of every hour of every day

*/10 * * * * Every 10 minutes

10 14 * * * At 14:10

10 14 1 * * At 14:10 on the first day of the month

10 14 15 1 * At 14:10 on 15 January

0 2 15 10 * At 2 AM on 15 October

0 3 * 10 0 At 3 AM on all Sundays in October

0 3 * 10 1 At 3 AM on all Mondays in October

@yearly @annually Shorthand for once a year (1 January)

@monthly @weekly @daily Shorthand for once a month

@hourly Shorthand for on every hour

@reboot On reboot

Command

Cron configuration is stored in a file called a crontab, which is specific to each user.

crontab -e Edit your crontab file

crontab -l List all entries in your crontab

crontab -r -i Remove the default crontab, after asking for confirmation

crontab -u Specify a different user's crontab

Files

/etc/cron.d Location for system cron entries

/etc/crontab Legacy system crontab

/var/spool/cron Location for user crontabs

/lib/systemd/system/crontab.service systemd cron service (systemd scans traditional cron locations and executes cron jobs as expected)

 

Tags : Linux,

Views : 610

Subscribe Us


Follow Us