How to start & enable crontab in ubuntu 16

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.service

I got following errors:

Failed to execute operation: No such file or directory

2:

systemctl status crond.service

I got following error:

● crond.service Loaded: not-found (Reason: No such file or directory) Active: inactive (dead)

3:

service crond status

I 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

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like