Cron Job won't start

borgqueenx

Verified User
Joined
Sep 2, 2019
Messages
19
In the admin account of directadmin i have a cronjob, but its never executing it.
Image: https://i.imgur.com/Lwrmlpi.png

Cron Log:
Code:
Sep  4 23:57:01 my CROND[19067]: (root) CMD (/usr/local/directadmin/dataskq)
Sep  4 23:58:01 my CROND[19087]: (root) CMD (/usr/local/directadmin/dataskq)
Sep  4 23:59:01 my CROND[19118]: (admin) CMD (/root/Backup.sh)
Sep  4 23:59:01 my CROND[19119]: (root) CMD (/usr/local/directadmin/dataskq)
Sep  5 00:00:01 my CROND[19155]: (root) CMD (/usr/sbin/csf --lfd restart > /dev/null 2>&1)
Sep  5 00:00:01 my CROND[19156]: (root) CMD (/usr/local/directadmin/dataskq)
Sep  5 00:01:01 my CROND[19241]: (root) CMD (/usr/local/directadmin/dataskq)
Sep  5 00:01:01 my CROND[19242]: (root) CMD (run-parts /etc/cron.hourly)
Sep  5 00:01:01 my run-parts(/etc/cron.hourly)[19242]: starting 0anacron
Sep  5 00:01:01 my anacron[19254]: Anacron started on 2019-09-05
Sep  5 00:01:01 my run-parts(/etc/cron.hourly)[19256]: finished 0anacron
Sep  5 00:01:01 my anacron[19254]: Normal exit (0 jobs run)

As you can see, it DID start the command apparently, but it simply didn't execute anything. If i run this command/the script manually from terminal, it executes fine.
 
also fixed this issue myself!

The cron job isnt working because its executing a root task, and the cron user admin does not have root permissions.
I changed the cronjob command to "sudo /root/Backup.sh" and assigned the admin user with sudo (root) permissions. Then i added "admin ALL=(ALL) NOPASSWD: ALL" to the sudoers file, so the admin user wont be asked to confirm the password when executing a sudo command.

All done, now i can execute root cron jobs from the admin account!
 
I read through all of this and then realized that somebody had resurrected an old thread. Is there any way to lock threads so there can be no responses after a certain amount of time?
 
Back
Top