I am using centos 6.4.
I have a few cron jobs setup and they all work fine.
However, I would like to enhance one of the crons.
This is what I have at the moment:
This works fine but I would like to improve on it like this:
nice rsync -au /home/samba/wsaler/* /home/samba/wsaler.backup/wsaler.backup18pm
date | /bin/mail -s "wsaler the curent date and time backup finished" jc@ukzone.com
Well understood. Still you could use grep on your mail file:
grep -E "^(From|Date|Subject):" /home/user/Mail/Local\ Folders/Inbox
Subject: New Private Message at Unix and Linux Forums
From: "UNIX.COM" <webmaster@unix.com>
Date: Sat, 21 Feb 2015 12:24:09 -0600 (CST)
Subject: Reply to thread 'I want to send an email after cron job'
From: "UNIX.COM" <webmaster@unix.com>
Date: Sat, 21 Feb 2015 14:36:25 -0600 (CST)
Hi RudiC...
I wander if you can help me a bit further.
What I would like to do now is to create a file with instructions in it, and include it as the BODY of the email.
At the moment I have:
date | /bin/mail -s " $TS Wholesaler TEST backup finished" jc@ukzone.com
This displays the current date and time in the body of the email.
I would like to have, e.g.
Instructions for restoration | /bin/mail -s " $TS Wholesaler TEST backup finished" jc@ukzone.com
This of course doesn't work. No body is displayed.
I would like to write the instructions in a seperate file and then include that file in the email as the body.
If this is podssible.
Hi Guys...
Thanks for your help.
I couldn't get blackrageous's suggestion to work, probably due to me being thick.
However, I did get RudiC's suggestion to work, with slight modification:
<BODY /bin/mail -s " $TS Wholesaler TEST backup finished" jc@ukzone.com
BODY being the name of the file containing the instructions.
I now need to make some text BOLD. Can anybody advise me how this is done in the BODY text file.