Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| engineering:computer_science:linux:anacron [2024/08/16 13:56] – removed - external edit (Unknown date) 127.0.0.1 | engineering:computer_science:linux:anacron [2024/08/16 13:56] (current) – ↷ Links adapted because of a move operation carlossousa | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Using anacron instead of cron ====== | ||
| + | |||
| + | Part of [[engineering: | ||
| + | |||
| + | ===== Why anacron? ===== | ||
| + | |||
| + | Sometimes, you want a job to be run, but you don't want to / can't assume that the host will be up and ready. | ||
| + | |||
| + | If that is the case, cron will not be an ideal fit, since it assume the last job was run as expected. | ||
| + | |||
| + | For this cases, we can use anacron. Do note that anacron only uses days, and not hours in it's calculations | ||
| + | |||
| + | ===== anacron Options ===== | ||
| + | |||
| + | Using the following example: | ||
| + | |||
| + | < | ||
| + | 7 15 test.daily | ||
| + | |||
| + | </ | ||
| + | |||
| + | Clarification | ||
| + | |||
| + | ^Value^Explanation| | ||
| + | |7|Number of days between each job execution| | ||
| + | |15|Delay in minutes, to run the job if the job is due| | ||
| + | |test.daily|Unique name identifier for the job| | ||
| + | |/ | ||
| + | |/ | ||
| + | |||
| + | \\ | ||
| + | |||
| + | |||
| + | ===== Using anacron ===== | ||
| + | |||
| + | To install anacron (in Debian): | ||
| + | < | ||
| + | |||
| + | sudo apt install anacron -y | ||
| + | |||
| + | </ | ||
| + | |||
| + | To edit anacron information: | ||
| + | |||
| + | < | ||
| + | sudo nano / | ||
| + | |||
| + | </ | ||