Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have the following cron tab installed:

crontab -l
# m h  dom mon dow   command
*/10 * * * * "echo" >> /tmp/cron.log

The server is at rackspace, it's a cloud server:

Linux myserver #8 SMP Mon Sep 20 15:54:33 UTC 2010 x86_64 GNU/Linux
Ubuntu 10.04 LTS

When I added this entry to the crontab using crontab -e I got the following message when I saved it:

crontab: installing new crontab

But it's not being executed, what is missing?

share|improve this question
3  
Echo should not be quoted there. Also you might want to provide the full path. Cron's $PATH environment variable is often very restricted. –  Caleb Apr 23 '11 at 19:05
    
You might also find it useful to run date instead of echo. This will give you a series of timestamps in your log file instead of sending a blank line! –  Caleb Apr 23 '11 at 19:07
1  
@Caleb: It works, it just creates a file with a blank line each time it runs. –  Iain Apr 23 '11 at 22:08
add comment

1 Answer

Things to check

Is cron running ?

$ ps aux | grep cron | grep -v grep
root      1015  0.0  0.0  21076  1020 ?        Ss   14:36   0:00 cron
$

If cron isn't running you can start it with

sudo service cron start

If cron is running then have a look in /var/log/syslog for any related messages

$ sudo grep CRON /var/log/syslog 
...
Apr 23 16:50:01 iain-10-04 CRON[5193]: (iain) CMD ("echo" >>/tmp/cron.log)
$

Any output from the cron job will also be mailed to the user who's job it is. Check the mail on the system.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.