3

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?

2
  • Did you give permission for execution? Have you tried the script before adding it to crontab?
    – maniat1k
    Dec 18, 2011 at 18:45
  • 2
    Also try using the full path, /bin/touch rather then touch
    – Panther
    Dec 18, 2011 at 18:47

3 Answers 3

4

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.

1

/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.

0

Check that you have a cron daemon running:

initctl list | grep cron

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .