Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Hi all I've configured manually the /etc/crontab to add an event that runs on day 9 every months...

The Cron is running, but it didn't runned my code yet... My code is at the last line:

17 *    * * *   root    cd / && run-parts --report /etc/cron.hourly
25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6    * * 7   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6    1 * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
23 9    9 * *   root    wget "" --no-cache --read-timeout=1600 -O "/var/log/$(date "+url-api.%d-%m-%y.log")"
share|improve this question
Canonical Answer for troubleshooting crontab:… – Eric Leschinski Feb 5 '13 at 15:31
up vote 3 down vote accepted

To make sure your cron is run, use "crontab -e" or "sudo crontab -e" to edit your cron jobs. Then when you're done editing and saved the file, crontab will install the new cronjob properly to be executed the next time.

So, use sudo crontab -e and make sure you at least do one modification to the file.

Also cron usually has no PATH variable, meaning it does know where to find wget, so the best is to put /usr/bin/wget.

share|improve this answer
crontab -e doesn't edit /etc/crontab – theotherreceive Jul 9 '10 at 12:13
cron usually has a minimal PATH, rather than no PATH, but it is a good idea to fully specify directory names. – Dennis Williamson Jul 9 '10 at 13:18

Your problem is that cron sees the percent signs as special. It converts them to newlines. You need to escape the percent signs to make them work normally.

23 9 9 * * root wget "" --no-cache --read-timeout=1600 -O "/var/log/$(date "+url-api.\%d-\%m-\%y.log")"

If you check your log file or root's email, you should see error messages complaining about the problem.

share|improve this answer
Or better yet, put your command in a simple shell script, and then call the script from the cromtab. – Ryan Thompson Jul 14 '10 at 6:43
+1, excellent answer. – poolie Nov 23 '10 at 5:52

Your Answer


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.