31 lines
601 B
Markdown
31 lines
601 B
Markdown
# Cron
|
|
|
|
An overview of using Ubuntu's built in Cron system.
|
|
|
|
***
|
|
### Edit Cron
|
|
```sh
|
|
sudo nano /etc/crontab
|
|
```
|
|
|
|
### Templates
|
|
```sh
|
|
[minute] [hour] [day_of_month] [month] [day_of_week] [user] [command_to_run]
|
|
* * * * * root /root/update.sh
|
|
```
|
|
|
|
| Field | Values allowed |
|
|
| --- | --- |
|
|
| Minute | 0 to 59 |
|
|
| Hour | 0 to 23 |
|
|
| Day of month | 1 to 31 |
|
|
| Month | 1 to 12 OR JAN to DEC |
|
|
| Day of week | 0 to 6 OR SUN to SAT |
|
|
|
|
| Special Syntax | Regular equivalent |
|
|
| --- | --- |
|
|
| @hourly | 0 * * * * |
|
|
| @daily | 0 0 * * * |
|
|
| @weekly | 0 0 * * 0 |
|
|
| @monthly | 0 0 1 * * |
|
|
| @yearly | 0 0 1 1 * | |