gregoryfenton
21-01-2011, 13:32
Hi Gary
No, the MAILTO goes on its own line.
If you want to log the output of a particular cron job then you can add ">> /home/gary/mycron.log 2>&1" at the end of each line you wish to log.
A sample crontab showing logging, not logging, mailing and not mailing is below:
logging:
not logging:
mailing:
not mailing:
No, the MAILTO goes on its own line.
If you want to log the output of a particular cron job then you can add ">> /home/gary/mycron.log 2>&1" at the end of each line you wish to log.
A sample crontab showing logging, not logging, mailing and not mailing is below:
logging:
Code:
* * * * * /path/to/job1 >> ~/cron.log 2>&1
Code:
* * * * * /path/to/job1 >> /dev/null 2>&1
Code:
* * * * * /path/to/job1 >> ~/cron.log 2>&1 MAILTO=cronjobs@yourdomain
Code:
* * * * * /path/to/job1 >> ~/cron.log 2>&1 MAILTO=""