===== Cron =====
==== What is Cron/ Crontab/ Cronjob? ====
[[https://en.wikipedia.org/wiki/Cron|Wikipedia - Cron]]
=== 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 |
=== Useful links ===
[[http://crontab-generator.org/|crontab-generator.org]]\\
\\
\\
~~DISCUSSION:closed~~