crontab
The file of scheduled jobs for a user, and the command that edits, lists or installs it.
Installing a crontab from a file silently replaces every existing scheduled job.
In more detail
Each line has five time fields, minute, hour, day of month, month and day of week, followed by the command; * means every, */5 means every fifth. crontab -e edits yours and crontab -l prints it. crontab file replaces the whole schedule with that file, so save the old one first.
Example
0 2 * * * /home/ada/bin/backup.sh >> /home/ada/log/backup.log 2>&1Related terms
- cron — The Unix and Linux service that runs commands automatically on a schedule, such as every night at two in the morning.
- absolute path — A path that starts from the top of the file system, such as /home/ana/notes.txt or C:\Users\ana\notes.txt, and so works from anywhere.
Taught in
- Help, History, Completion And Aliases — Bash Scripting & Command Line Automation
- Scheduling, Monitoring And A Script That Reports — Bash Scripting & Command Line Automation
- Scheduling: cron, at And systemd Timers — Red Hat Certified System Administrator (EX200) Exam Prep
- Mock Exam, Part 1: Eighteen Tasks, One Reboot — Red Hat Certified System Administrator (EX200) Exam Prep
- The Reindex That Died With The VPN: Jobs, cron, at And Timers — CompTIA Linux+ (XK0-006) Exam Prep
- Root Over SSH From Anywhere: Keys, sshd, setuid Files And Attributes — CompTIA Linux+ (XK0-006) Exam Prep
- Scheduling: cron Jobs With Names, And Timers — RHCE in Ansible (EX294): Automate Red Hat Systems
- Drill: People, Passwords And sudo From The Vault — RHCE in Ansible (EX294): Automate Red Hat Systems