User Tools

Site Tools


linux:general:crontab

Cron

What is Cron/ Crontab/ Cronjob?

How to edit a cron

For global use, edit “/etc/cron.d/general”
For a specific user, execute “crontab -e” with that user.

 ┌───────────── minute (0 - 59)
 │ ┌───────────── hour (0 - 23)
 │ │ ┌───────────── day of month (1 - 31)
 │ │ │ ┌───────────── month (1 - 12)
 │ │ │ │ ┌───────────── day of week (0 - 6) (Sunday to Saturday;
 │ │ │ │ │                                       7 is also Sunday)
 │ │ │ │ │
 │ │ │ │ │
 * * * * *  command to execute

Commands

Command Function
crontab -e Edit crontab of the current user
crontab -l List all crons of the current user
crontab -u <user> -e Edit crontab of another user
for user in $(cut -f1 -d: /etc/passwd); do echo $user; crontab -u $user -l; done
List crons of all users
linux/general/crontab.txt · Last modified: 2019/10/07 10:59 by lunetikk