This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| tech:unix:crontab [2020/07/03 13:33] – travis | tech:unix:crontab [2020/07/30 00:06] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Crontab ====== | ====== Crontab ====== | ||
| - | {{howhard> | ||
| - | If you're from Windows World, crontab is Unix's Task Scheduler, only it's better. | ||
| - | On macOS, you can install a crontab for your local user by running the following (using the nano editor) | + | {{howhard> |
| + | |||
| + | ===== Install Crontab ===== | ||
| + | |||
| + | On macOS (and this should work on any other *NIX), you can install a crontab for your local user by running the following (using the nano editor) | ||
| + | |||
| + | < | ||
| + | |||
| + | On the first line, you can then enter the command you want to run and how long to run it. | ||
| + | |||
| + | < | ||
| + | * * * * * command to execute | ||
| + | │ │ │ │ │ | ||
| + | │ │ │ │ └─── day of week (0 - 6) (0 to 6 are Sunday to Saturday, or use names; 7 is Sunday, the same as 0) | ||
| + | │ │ │ └──────── month (1 - 12) | ||
| + | │ │ └───────────── day of month (1 - 31) | ||
| + | │ └────────────────── hour (0 - 23) | ||
| + | └─────────────────────── min (0 - 59) | ||
| + | |||
| + | </ | ||
| + | |||
| + | Press CTRL+O and CTRL+X to save and exit. | ||
| + | |||
| + | ===== Remove Crontab ===== | ||
| + | If you need to remove a single entry, you can edit your crontab with '' | ||
| + | |||
| + | If you want to eliminate the crontab entirely, run the following: | ||
| < | < | ||
| - | env EDITOR=nano | + | crontab -r |
| </ | </ | ||
| - | On the first line, you can then enter the command you want to run and how long to run it. | ||
| - | '' | + | |