* Front Page * Table of Contents * Return to Town

Cron

With cron you can run scripts at a given date/time

Open cron

$ crontab -e

Basic

run script every minute/hour/day/year/week
* * * * * /home/user/script.sh

run script every day at 12:10
10 12 * * * /home/user/script.sh

run script every 3h
* */3 * * * /home/user/script.sh

run script every day at 2/5/7 AM
* 2,5,7 * * * /home/user/script.sh

Cheat sheet

#minute (0-59),
#| hour (0-23),
#| | day of the month (1-31),
#| | | month of the year (1-12),
#| | | | day of the week (0-6 with 0=Sunday).
#| | | | | commands

*/5 2 * * 0,4 sh /home/user/script.sh

last compiled: 2022-08-07 08:56:07.545629