log errors in cron job
Hi, on my Centos 5.2 system I run a cron job every night which backs up files from disk to a usb stick. The job simply creates a directory on the usb stick and then copies the files from disk to this new directory.
If I am not around I don't expect any of the other guys here to be able to diagnose a problem so I would like to copy a red light/green light file into a particular directory for their reference. I will act from there. I am currently using "cp" to copy the files. Is there an error condition I can attach to this? Would "rsync" be a better option? Any other options to report errors in cron jobs? |
if
cp ....... then echo "woohoo!" > /my/file else echo "D'Oh!" > /my/file fi Compliments of the Bisman LUG |
You can also use something like this to check if certain files exist:
Code:
TestFile=/my/file |
All times are GMT -5. The time now is 07:32 AM. |