check if cron is setup and working on the server

Monday, 3. October 2011

If you want to quickly check if cron is setup and working on your server without sending emails, here is a nice and quick way to test it.

1) Open crontab

crontab -e #: open as another user: crontabl username -e

2) at the bottom of the file add this:

* * * * * touch /tmp/.test_if_cron_is_working

3) This should create a file .test_if_cron_is_working every minute to the /tmp folder.

Navigate to make sure it has been created.

cd /tmp
ls -l

If you can’t see the file after 2 minutes, your cron system is not enabled/working.

Leave a Reply

You must be logged in to post a comment.