Reputation: 51
I have a variety of Ubuntu servers on which I use cronjobs. However, on one of them, I cannot get crontab to function. Generally, when I want to restart the cron daemon, I do this and get the following result:
~$ sudo service cron restart
cron stop/waiting
cron start/running, process 26310
However, on this Ubuntu version I get the following:
root@f5ba9eb61881:~# sudo service cron restart
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service cron restart
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the stop(8) and then start(8) utilities,
e.g. stop cron ; start cron. The restart(8) utility is also available.
I am unable to get the cron daemon to log information when I would expect it to run. I have followed this thread: https://askubuntu.com/questions/56683/where-is-the-cron-crontab-log/121560 and I have followed the advice of user12345 but to no avail.
I have a job scheduled in crontab (using sudo crontab -e) scheduled to run every minute:
# m h dom mon dow command
* * * * * /home/ace_request_blast.sh >> /home/myscript.log 2>&1
However, all I see in the syslog is my edits to crontab, meaning the job is not running.
root@e43d3c67124f:/var/www/journa# sudo tail -f /var/log/syslog
Oct 14 01:15:47 e43d3c67124f crontab[2050]: (root) REPLACE (root)
Oct 14 01:15:47 e43d3c67124f crontab[2050]: (root) END EDIT (root)
Oct 14 01:15:57 e43d3c67124f crontab[2062]: (root) BEGIN EDIT (root)
Oct 14 01:16:09 e43d3c67124f crontab[2062]: (root) REPLACE (root)
Oct 14 01:16:09 e43d3c67124f crontab[2062]: (root) END EDIT (root)
Oct 14 01:18:43 e43d3c67124f crontab[2148]: (root) BEGIN EDIT (root)
Oct 14 01:18:58 e43d3c67124f crontab[2148]: (root) REPLACE (root)
Oct 14 01:18:58 e43d3c67124f crontab[2148]: (root) END EDIT (root)
Oct 14 01:27:25 e43d3c67124f crontab[2224]: (root) BEGIN EDIT (root)
Oct 14 01:27:35 e43d3c67124f crontab[2224]: (root) END EDIT (root)
Any ideas on how to get the cronjob to run? I figure it might be some sort of permissions issue.
Upvotes: 1
Views: 621
Reputation: 35
Please do try this
systemctl start SERVICE
Taken from here https://askubuntu.com/questions/19320/how-to-enable-or-disable-services
SYSTEMD Starting with Ubuntu 15.04, Upstart will be deprecated in favor of Systemd. With Systemd to manage the services we can do the following:
Hope it was helpful.
Upvotes: 0