I have aws image that I have created using ubuntu 16. Where I have cronjob running, I want to make sure that when I start new machine using this image, it (cronjobs) still run new machine.
when I tried following commands
1:
systemctl enable crond.serviceI got following errors:
Failed to execute operation: No such file or directory2:
systemctl status crond.serviceI got following error:
● crond.service Loaded: not-found (Reason: No such file or directory) Active: inactive (dead)3:
service crond statusI got following error:
● crond.service Loaded: not-found (Reason: No such file or directory) Active: inactive (dead) 1 3 Answers
4 ways to check status of cron service in Ubuntu:
ps -ef | grep cron
systemctl status cron.service
service cron status
/etc/init.d/cron status As @steeldriver mentioned it is cron.service not crond.service difference with systemd. Anyways you can edit your cronjobs through crontab -ejust follow the instructions for setting the time for each cronjob at the bottom. And when you're done simply save the file and it should say "installing new cronjob", then voila it will magically execute the script at the given time.
Just run:
sudo systemctl enable cron