1

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?

2

There should be a log file here:

/var/log/cron.log

or similar.

1

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.

1

you can add a line saying:

 MAILTO=your-mail.com

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

1
  • Assuming a properly formatted email address (that is correct, etc.) – Dennis Williamson Dec 3 '09 at 12:28
0

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

1
  • 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

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.