Hi all - looking for someone to help with my shell script. I want the script below to email verbose results. And in the event of an error, put that in the subject line of the email (and put error details in the body?).
I'm not familiar with the actual process you propose but for mailing I would look into sendemail (note the E in the middle of that!).
I use sendemail for quite a few scripted and other apps (luckybackup, urlwatch etc). Quite versatile, allows proper FQDN and so on to get over anti-spam setups, and has syntax for sending files as the message body.
Would I be correct in reading from your script that the fact the backup has completed is no guarantee that any backup has actually occurred? There seems to be no error trapping, is my point.
In passing, I backup my own MySQL databases (mainly windows) from within the admin or workbench software.
correct - in the script there is no error trapping. I can see it in the verbose results if I just execute the rsync from the command line, but I am using cron to run this script - so when it is done executing it sends me an email - which works - I just need it to display if any errors occured, OR just port the verbose to the email body. I just don't know how to do it.