1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-29 23:24:55 +02:00
tldr/pages/common/crontab.md

37 lines
817 B
Markdown
Raw Normal View History

2016-02-15 11:02:20 -05:00
# crontab
> Schedule cron jobs to run on a time interval for the current user.
2022-07-09 16:36:19 +01:00
> More information: <https://crontab.guru/>.
2016-02-15 11:02:20 -05:00
- Edit the crontab file for the current user:
`crontab -e`
- Edit the crontab file for a specific user:
`sudo crontab -e -u {{user}}`
2020-11-20 23:01:33 +01:00
- Replace the current crontab with the contents of the given file:
`crontab {{path/to/file}}`
2016-02-15 11:02:20 -05:00
- View a list of existing cron jobs for current user:
`crontab -l`
- Remove all cron jobs for the current user:
`crontab -r`
2016-03-14 19:25:51 +00:00
- Sample job which runs at 10:00 every day (* means any value):
2016-09-07 23:10:11 +05:30
`0 10 * * * {{command_to_execute}}`
2016-09-07 23:10:11 +05:30
2022-07-09 16:36:19 +01:00
- Sample crontab entry, which runs a command every 10 minutes:
2016-09-07 23:10:11 +05:30
2022-07-09 16:36:19 +01:00
`*/10 * * * * {{command_to_execute}}`
2016-09-07 23:10:11 +05:30
2022-07-09 16:36:19 +01:00
- Sample crontab entry, which runs a certain script at 02:30 every Friday:
2016-09-07 23:10:11 +05:30
`30 2 * * Fri {{/absolute/path/to/script.sh}}`