Do I have to restart cron after changing the crontable file?
-
11Not to disregard @leonbloy's answer, but I found that implementing my linux's first cron job (a correctly formatted per minute job) didn't action until the system was rebooted. `sudo service cron restart` wasn't tested. – geotheory Jul 02 '14 at 09:56
-
4@geotheory yikes I sure hope I don't have to restart my prod server any time I update my crontab (and I don't). – jcollum Nov 08 '16 at 20:46
12 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
-
13If using cron.d folder, symlinked crontabs will not be reloaded. How can I force a reload? – CMCDragonkai Jan 10 '14 at 18:00
-
2
-
16
-
22Better option is reload - it can be initiated by non-root user: ```/etc/init.d/cron reload``` – Honza May 06 '14 at 04:50
-
15
-
58The only problem with this answer is that it's not always true. See geotheory's comment underneath the question. I, too, was bit by this. I made a change to the crontab file via `sudo crontab -e`, saved the change by `Ctrl + X`, and went away assuming `cron` would pick it up (due to this answer being so highly upvoted). Then, days later my client reports that the cron is still running on the old cycle. So - honestly - if you want to be safe - just restart either `cron` or the system, and don't play around with wasted time testing, which you'll have to do despite this highly-upvoted answer. – Dan Nissenbaum Oct 14 '15 at 22:53
-
sudo service crond reload works for me to reload de cron definition files on /etc/crontab – ChoCho Mar 28 '18 at 20:26
-
On FreeBSD and OpenBSD you need to restart the cron service after create a file under /var/cron/tabs/user or /var/cron/tabs/user – rfmoz Aug 15 '18 at 09:12
-
1On my Raspberry Pi 3+ with Ubuntu 18.04.2 LTS the only command that worked for me was: `sudo service cron reload`. It was also the only command which gave a response: `* Reloading configuration files for periodic command scheduler cron`. – Jan Apr 19 '19 at 08:44
-
I guess this is distribution-specific. On Ubuntu 20.04, with default (Vixie) cron, plain edits (with `vim`, not `crontab`) to a user-specific crontab (`/var/spool/cron/crontabs/user-foo`) *are* picked up and acted on immediately; tested with a per-minute echo and `tail`ing the user's mail file. This is also true if you simply copy in the user's cron file during installation. – EML Jan 30 '22 at 17:48
On CentOS with cPanel sudo /etc/init.d/crond reload
does the trick.
On CentOS7: sudo systemctl start crond.service

- 43,623
- 55
- 191
- 321

- 1,700
- 16
- 10
-
5
-
4// , To reload `crond`, rather than just start it on the increasingly horrible systemd, run `sudo systemctl reload crond.service`. – Nathan Basanese Oct 03 '18 at 18:26
-
1@NathanBasanese Reloading `cron` on SystemD now is considered black magic: `sudo systemctl reload crond` fails with `Failed to reload cron.service: Job type reload is not applicable for unit cron.service.` (Ubuntu 18.04). Read: Heads off, we all are pwned by the syndrome: "SystemD, there can be only one". If reload is not done automagically behind the scenes, you are bust! Do not even think about fixing it, like you did for the last 3 (or more) decades! Read: **The world of Windows has finally swallowed Debian: If there's something strange under the hood, what you gonna do? Restart!** – Tino Jan 16 '19 at 19:55
-
Restart is more than just reload. Isn't there a clean reload option available for Centos? – Ωmega Apr 18 '19 at 19:46
-
I had a similar issue on 16.04 VPS Digital Ocean. If you are changing crontabs, make sure to run
sudo service cron restart
-
1
-
1In my case Rasperian with PI zero and changes in /var/spool/cron/crontabs/root I had to use `restart` – mikep Aug 10 '21 at 11:30
-
Had the same problem as @mikep on an old openSUSE 10 machine. Only `restart` worked. – mgutt Oct 05 '21 at 08:08
Commands for RHEL/Fedora/CentOS/Scientific Linux user
Start cron service
To start the cron service, use:
/etc/init.d/crond start
OR RHEL/CentOS 5.x/6.x user:
service crond start
OR RHEL/Centos Linux 7.x user:
systemctl start crond.service
Stop cron service
To stop the cron service, use:
/etc/init.d/crond stop
OR RHEL/CentOS 5.x/6.x user:
service crond stop
OR RHEL/Centos Linux 7.x user:
systemctl stop crond.service
Restart cron service
To restart the cron service, use:
/etc/init.d/crond restart
OR RHEL/CentOS 5.x/6.x user:
service crond restart
OR RHEL/Centos Linux 7.x user:
systemctl restart crond.service
Commands for Ubuntu/Mint/Debian based Linux distro
Debian Start cron service
To start the cron service, use:
/etc/init.d/cron start
OR
sudo /etc/init.d/cron start
OR
sudo service cron start
Debian Stop cron service
To stop the cron service, use:
/etc/init.d/cron stop
OR
sudo /etc/init.d/cron stop
OR
sudo service cron stop
Debian Restart cron service
To restart the cron service, use:
/etc/init.d/cron restart
OR
sudo /etc/init.d/cron restart
OR
sudo service cron restart
Source: https://www.cyberciti.biz/faq/howto-linux-unix-start-restart-cron/

- 17,147
- 12
- 117
- 144
-
2This does not appear to attempt to answer the question at the top of this page at all. Please review the [help] and in particular [How do I write a good answer?](/help/how-to-answer) – tripleee Mar 30 '21 at 06:02
Depending on distribution, using "cron reload" might do nothing. To paste a snippet out of init.d/cron (debian squeeze):
reload|force-reload) log_daemon_msg "Reloading configuration files for periodic command scheduler" "cron"
# cron reloads automatically
log_end_msg 0
;;
Some developer/maintainer relied on it reloading, but doesn't, and in this case there's not a way to force reload. I'm generating my crontab files as part of a deploy, and unless somehow the length of the file changes, the changes are not reloaded.

- 315
- 1
- 3
- 8
-
perhaps HUPping the process works in systems with service reload disabled? – teknopaul Feb 08 '23 at 17:13
If file
/var/spool/cron/crontabs/root
edited via SFTP client -service cron restart
needed. Reload service not work.If edited file
/var/spool/cron/crontabs/root
via console linux (nano, mc) - restart NOT needed.If edited cron via
crontab -e
- restart NOT needed.
Try this: service crond restart
, Hence it's crond
not cron
.

- 2,000
- 2
- 28
- 34
-
5`crond` unrecognized service. It work with `cron` for me. my OS is Ubuntu 18.04 – Tien Nguyen Dec 31 '19 at 05:17
There are instances wherein cron needs to be restarted in order for the start up script to work. There's nothing wrong in restarting the cron.
sudo service cron restart

- 428
- 3
- 10
On CentOS (my version is 6.5) when editing crontab you must close the editor to reflect your changes in CRON.
crontab -e
After that command You can see that new entry appears in /var/log/cron
Sep 24 10:44:26 ***** crontab[17216]: (*****) BEGIN EDIT (*****)
But only saving crontab editor after making some changes does not work. You must leave the editor to reflect changes in cron. After exiting new entry appears in the log:
Sep 24 10:47:58 ***** crontab[17216]: (*****) END EDIT (*****)
From this point changes you made are visible to CRON.

- 3,887
- 6
- 36
- 59
Ubuntu 18.04 * Usage: /etc/init.d/cron {start|stop|status|restart|reload|force-reload}

- 129
- 1
- 1