Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Restarting cron after changing crontab file? [closed]

Do I have to restart cron after changing the crontable file?

like image 774
bArmageddon Avatar asked Apr 17 '12 15:04

bArmageddon


People also ask

Do I need to restart cron after changing crontab?

No. As long as you use the crontab -e command to edit the file, when you save it, you'll get a 'New Crontab Installed' message.

How do you refresh a cron job?

To run a cron job at every system boot, add a string called @reboot to the end of the task list. The job defined by this string runs at startup, immediately after Linux reboots. Note: Always use the full path to the job, script, or command you want to run, starting from the root.

Can you edit crontab file?

When you create a crontab file, it is automatically placed in the /var/spool/cron/crontabs directory and is given your user name. You can create or edit a crontab file for another user, or root, if you have superuser privileges.


1 Answers

No.

From the cron man page:

...cron will then examine the modification time on all crontabs and reload those which have changed. Thus cron need not be restarted whenever a crontab file is modified

But if you just want to make sure its done anyway,

sudo service cron reload 

or

/etc/init.d/cron reload 
like image 135
5 revs, 3 users 60% Avatar answered Sep 17 '22 15:09

5 revs, 3 users 60%