Test CRON

You may want to test if the CRON is running on your server.  There is few ways in order to test it.  Among those possibilities, this would be an easy one:

Test if cron is running

With SSH access
1) Log to your server using SSH

2) execute the following:
ps ax | grep cron

The output should be similar to the following:
628701 pts/1    S+     0:00 grep cron

If you have a similar output, awesome!  Your CRON is running.


Test if cron is working

Let's add the following entry to your crontab and see if it is executed. To do so:

1) enter the command:
crontab -e

2) append the following to the configuration:
* * * * * /bin/echo "MyCRON" >> ~/crontest.txt

After a minute, a file should be created (crontest.txt) under the specified path (at your home root), holding the "MyCRON" content. If you can see the file, congrats, cron is working fine.


Clean up our test
Now we must silence our test

1) enter the command:
crontab -e

2) remove the following from the configuration:
* * * * * /bin/echo "MyCRON" >> ~/crontest.txt


If you have root access
You can always check the cron log for errors. The usual location for that would be:

/var/log/cron

or

/var/log/messages

/var/log/cron.log or /var/log/messages for errors


Feel free to contact us if further support is needed.
  • 1 Users Found This Useful
Was this answer helpful?

Related Articles

[EA3] New Relic APM on cPanel & CloudLinux CageFS

Many System Administrators tried to get PHP apps hosted on a cPanel server with CloudLinux and...

[EA4] New Relic APM on cPanel & CloudLinux CageFS

Many System Administrators tried to get PHP apps hosted on a cPanel server with CloudLinux and...

Installing GeoIP (PECL) on WHM

In order to install GeoIP via PECL on a WHM enabled server, you must first install 2 modules:1)...

Installing IPSet on CentOS

CSF (ConfigServer Firewall) on a Linux system and you block a lot of IP addresses, performance...

Tweak the swapinness

What is swappiness and why should I change it? swappiness is a value between 0 and 100 which...