0

I got this funny problem. I have an entry in the in cron like this

50 15 * * * /pmecs/log/lsmon/techsupportscript.sh 2>/pmecs/log/lsmon/cronerror.log

Now, from what i know, this is correct syntax. This script is supposed to run at 15:50 everyday. But it doesn't. I checked the date,timezone etc, everything is fine.. I change it to

* * * * * /pmecs/log/lsmon/techsupportscript.sh 2>/pmecs/log/lsmon/cronerror.log

i.e run every minute, it runs perfectly.. Can anyone give any suggestions as to how do i find out what is going wrong here?

1
  • 1
    When you say "in the cron", do you mean in your own crontab (crontab -e) or in the system's crontab (/etc/cron.d/something) ? The format is different than the one you use in the second case.
    – raphink
    Jan 8, 2010 at 10:57

1 Answer 1

1

few ways to troubleshoot

1) Check /var/log/cron 
2) check /pmecs/log/lsmon/cronerror.log for clues. 
3) check your mail using mailx/mail. 
4) add a cron.debug to /etc/syslog.conf (search google for examples)
5) try changing the order of redirection

50 15 * * * /pmecs/log/lsmon/techsupportscript.sh >/pmecs/log/lsmon/cronerror.log 2>&1
2
  • I havent configured mail so i wont get an email. I'll have to try out point number 4. i even tried 50 15 * * * echo "I have been called " > /pmecs/log/lsmon/cronerror.log In /var/log/cron all I could see are BEGIN EDIT and END EDIT. Jan 8, 2010 at 11:09
  • Can you disable local mail? Generally if you "su root" you can run mailx/mail/mutt and see cron emails. They just won't go to another machine (Ex: your gmail account) without extra configuration.
    – bobpaul
    Dec 17, 2013 at 23:05

You must log in to answer this question.