[SOLVED] Daily cron script is not executed


I have set up a script in the /etc/cron.daily folder which is not executed for some reason.

This is the script, I have blurred out the upload to my personal ftp server and switched to github.

I 've already tested it executing it directly and have ssh keys deployed on github, no passphrase is asked even after reboot, so it should run ok, but it is not.


did you checked to have the script located directly inside /etc/cron.daily and not using a symlink. As well you can have a look what will be executed as follow

run-parts --list /etc/cron.daily
dietpi@DietPiZero:~$ run-parts --list /etc/cron.daily/

It is symlinked, but will try to have it inside the directory directly. Its the “updater” script.

Looks like even this didn’t work. I mean copying and pasting the script directly into the cron.daily folder.

you could run run-parts --test /etc/cron.daily to check which scrits are going to be executed. And using run-parts /etc/cron.daily to actually have them executed. As well you can have a look if cron is executed at all journalctl -u cron.service or systemctl status cron.service

Btw: if you don’t like to play with all daily cron jobs, you can move your script into /etc/cron.monthly: Usually it should be empty.

I 'll mark this thread as solved. Reason for this is that I had to deploy ssh keys ALSO into the root user.

ah indeed, cron is executed as root user. Makes sense to have the SSH key deployed on root user as well :slight_smile: