Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

i did something as simple as this:

crontab -e 

* * * * * touch /home/alexis/hi.txt

crontab: installing new crontab

but it doesn't work at all; not mentioning more complicated scripts. any idea what went wrong?

share|improve this question
    
Did you give permission for execution? Have you tried the script before adding it to crontab? –  maniat1k Dec 18 '11 at 18:45
    
Also try using the full path, /bin/touch rather then touch –  bodhi.zazen Dec 18 '11 at 18:47

3 Answers 3

The normal user-PATH isn't used, when running crontab.

Either you use the full path to touch (/usr/bin/touch), or you set the PATH in the crontab file itself, if you need it multiple times.

share|improve this answer

/var/log/syslog contains a detailed log of cron activity. Since your cron is set to run every minute, the log should contain plenty of entries indicating exactly what went wrong. Checking that the PATH is set is one possibility. Have a look at the file I mention and if you have trouble interpreting the error message, please edit your question and add the entire line that contains the error. Someone is bound to be able to help you with this.

share|improve this answer

Check that you have a cron daemon running:

initctl list | grep cron
share|improve this answer

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.