Quantcast
Viewing all articles
Browse latest Browse all 12

How to fix ‘Crontabs not running’ problem

I have a VPS that I am using for a cPanel DNS-only setup and I was wondering why crontab was not running on this particular VPS.

In my particular case, logwatch (a package on CentOS) was not sending me emails. Yes, the settings were correct to send me emails.

Step 1: Verify that your crontab-scripts are actually working

root@ns4 [~]# /usr/share/logwatch/scripts/logwatch.pl

 

Step 2: Verify that crontabs is installed (yes its a package in CentOS that can be uninstalled, most minimalistic templates have it either uninstalled or turned off)

root@ns4 [~]# yum install crontabs
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror01.th.ifl.net
 * extras: mirror01.th.ifl.net
 * updates: mirror01.th.ifl.net
Excluding Packages in global exclude list
Finished
Setting up Install Process
Package crontabs-1.10-8.noarch already installed and latest version
Nothing to do

 

Step 3: Verify that crontabs is running

root@ns4 [~]# /etc/init.d/crond status
crond is stopped

Now that we have found the issue and (I for sure) know that the issue remains even after VPS-reboots so I did this

 

Step 4: Mark crond package to autostart as soon as a VPS is rebooted

root@ns4 [~]# chkconfig crond on

 

Step 5: Start the crond service this time (without the need of rebooting your VPS)

root@ns4 [~]# /etc/init.d/crond start
Starting crond:                                            [  OK  ]

That’s it. I hope you enjoyed reading the easy to understand How-to to fix your crontabs


Viewing all articles
Browse latest Browse all 12

Trending Articles