You are not logged in.
Pages: 1
Hello,
I have a script (let's call it test.sh) that is correctly executed by cron at
scheduled hours every day. It runs on a machine that is not on 24/h. Therefore,
I'd like anacron to run it at boot time when there was a miss.
From what I understand, i have to put the script in /etc/cron.daily, which I did.
My /etc/anacrontab is the default one.
Nothing happens at the next boot when the cron job was missed.
If i do
# anacron -f -n
to force immediate execution, nothing happens either. Entries are written in journalctl :
JJob `cron.daily' started
Job `cron.daily' terminated
but the script test.sh is not executed.
Also, when I run
# anacron -T
nothing is displayed (from the man page, I should have either 0 or 1 depending on whether
the /etc/anacrontab file is valid).
Any idea ?
Many thanks
Offline
I cannot help you with anacron, but you could use systemd instead. I think that's the Arch way, nowadays.
https://wiki.archlinux.org/index.php/Systemd/Timers
Offline
I cannot help you with anacron, but you could use systemd instead. I think that's the Arch way, nowadays.
https://wiki.archlinux.org/index.php/Systemd/Timers
Well, thank you for the suggestion. Indeed, it is sounder to do it with a service and a timer (launched daily).
Besides, I find it easier to run it with user permissions this way (must be doable with anacron too but seems less straightforward).
So I think I will drop anacron (and cron) completely on a machine that is not always on.
Offline
Pages: 1