Sudo Crontab not Executing

General support questions
pjsr2
Posts: 614
Joined: 2014/03/27 20:11:07

Re: Sudo Crontab not Executing

Post by pjsr2 » 2017/11/06 21:32:22

The server is an ec2 amazon instance
Is your instance continuously running? With crontab files, the task will not run when the machine is not running at the specified time.
When the instance is not continuously running, it is better to put the task in /etc/cron.daily , which is used by anacron. Anacron will run the task as soon as it notices that the task wasn't run during the last 24 hours.

edencorbin
Posts: 5
Joined: 2017/11/05 19:28:38

Re: Sudo Crontab not Executing

Post by edencorbin » 2017/11/07 02:52:26

Well perhaps it wasn't Cron that wasn't working, this executed fine:

* * * * * /usr/local/bin/node /home/beta/test.js

So I will dig deeper into why the original command is having issues, but it seems not to be Cron

15 3 * * * /usr/bin/certbot renew --quiet

Thanks for all the answers / help, learned a few things about my Cron tasks. The cron task is indeed at /var/spool/cron/root, however at least in the case of the node command no "root" was required in my Cron task.

pjsr2
Posts: 614
Joined: 2014/03/27 20:11:07

Re: Sudo Crontab not Executing

Post by pjsr2 » 2017/11/07 16:54:24

Cron jobs execute in a very limited environment. You may need to add additional directories to PATH or set more environmental variables. These can be set/added in the cron file.

Post Reply