Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

how i can make that every thing i put it in crontab is working? is there any logs for cron to see whether if worked successfully or not?

share|improve this question

4 Answers 4

There should be a log file here:

/var/log/cron.log

or similar.

share|improve this answer

If your scheduled commands provide some output your can add something like

> /home/your_user/log_dir/command.log at the end of your cron job entry.

Hope this helps.

share|improve this answer

Hey, you can add a line saying:

 MAILTO=your-mail.com

You will receive a mail then, when your cronjob gets executed.

share|improve this answer
    
Assuming a properly formatted email address (that is correct, etc.) –  Dennis Williamson Dec 3 '09 at 12:28

if you on a nix box, you can add the line after the cron;

  • 5 * * * /root/doacron.sh | mail -s 'subjecthere' me@mydomain.com

works well...

share|improve this answer
1  
Script output is mailed to the owner of the crontab by default. It is not necessary to pipe it to mail. If you want to specify one or more other recipients you set the MAILTO variable. See man 5 crontab –  Dennis Williamson Dec 3 '09 at 12:27

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.