This document outlines how to use
cron for scheduling events.
cron if it is not already setup on your system.
sudo apt update && sudo apt install cron
Open the terminal and type,
This will open the crontab (cron configuration file) for your user account.
The first time you run this command it may give you the following prompt:
no crontab for anthony - using an empty one
I recommend selecting option 1.
Then you should see a
crontab file open on your screen that looks like this,
# Edit this file to introduce tasks to be run by cron.
Each line you add can define one command to run and its schedule.
The format structure is listed in the file as
m h dom mon dow command or spelled out thats,
day-of-week (0-7) followed by the
The following entry would execute a shell script (
incremental-backup) at 11:00 and 16:00 (twice) each day.
00 11, 16 * * * /home/user/bin/incremental-backup
The comma separated value in a field allows us to specify that the command needs to be executed at multiple times.
Commands that normally run with administrative privileges should be added to the
To edit the
sudo crontab -e