Menu Close

log cron jobs

If you need to check what is the output from every cron job (instead of see only when start and stop it in var/log/syslog)

you can append to your cron command this text:

 2>&1 >> /var/log/myjob.log

and here you can see a working example:

rsync -avz /home/www/ /mnt/ububackup/SITE_BACKUP 2>&1 >> /var/log/backupUbu.log

This cron sync my www folder to another server and log the output to backupUbu.log .

 

Posted in Linux, News

Leave a Reply

Your email address will not be published. Required fields are marked *