Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

migrated from stackoverflow.com Jan 8 '10 at 10:51

This question came from our site for professional and enthusiast programmers.

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. –  ℝaphink Jan 8 '10 at 10:57
add comment

1 Answer

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
share|improve this answer
    
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. –  Uday Jan 8 '10 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 '13 at 23:05
add comment

Your Answer

 
discard

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