Ravi Sir's Cyber Security Cards › Revision Cards
Scheduling Tasks: cron
Scheduling Tasks: cron cron runs commands on a schedule. You set jobs with crontab -e . 30 1 * * * /home/ec2-user/backup.sh = run the backup every night at 1:30 AM . Order: minute, hour, day, month, weekday. In an investigation, check crontab -l for each user, /etc/crontab and /etc/cron.d/ . Attacke

Read card text
What this card says
What it is
cron runs commands on a schedule. You set jobs with crontab -e.
Example
30 1 * * * /home/ec2-user/backup.sh
= run the backup every night at 1:30 AM. Order: minute, hour, day, month, weekday.
Why it matters for security
In an investigation, check crontab -l for each user, /etc/crontab and /etc/cron.d/. Attackers hide jobs there.
A root cron job that runs a file anyone can edit = easy root for an attacker.
| Schedule | Meaning |
|---|---|
| /5 * * * * | Every 5 minutes |
| 0 2 * * * | Every day at 02:00 |
| 30 9 * * 1-5 | 09:30 Monday to Friday |
| 0 0 1 * * | Midnight on the 1st of every month |
| @reboot | Once at every boot |
Learn more in the lesson: 6.9 Scheduling Tasks: cron