For testing I wrote this bash script
#! /bin/bash
echo "Time: $(date)" >> /home/benno/Desktop/anacron
which I want to execute with anacron on a daily basis.
I therefore added the following line to my /etc/anacrontab file
1 0 benno /home/benno/Desktop/anacronCheck.sh
However, when I run the command anacron -n (running all jobs without time delay) nothing happens.
Any suggestions why anacron is not running my bash script?
The solution was to run anacron via the following command
sudo anacron -fdn
anacron needs root privileges otherwise it wont do anything, hence sudo.
The -f and -n parameter together force all jobs to be executed immediately disregarding of timestamps and delays. -d prevents anacron from forking into the background -> error messages will otherwise not be printed to the console.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With