====== Using anacron instead of cron ====== Part of [[engineering:computer_science:linux:linux|Linux]] ===== 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 /bin/sh /home/username/script.sh 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| |/bin/sh|Bash to use| |/home/username/script.sh|Script Location| \\ ===== Using anacron ===== To install anacron (in Debian): sudo apt install anacron -y To edit anacron information: sudo nano /etc/anacron