LinkBack Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 29-Jul-2009, 09:28 AM
Junior Member
 
Join Date: Jul 2009
Posts: 2
brcre 0 reputation points
Default Trip a SEND flag in Evolution

Example of what I'm talking about:
Code:
#!/bin/bash
# Email To ?
TOO="Dist_1 <handle@gmail.com>,Dist_2 <Handle@hotmail.com>"
FROM="User_Name <Handle@gmail.com>"
SUBJECT="Nightly Computer BackUp"
EMAILMESSAGE="/tmp/AutoEmail1"
MBOX="/home/usr/.evolution/mail/local/Outbox"

#This is the email Header
date "+From $FROM %a %b %e %T %Y" > $EMAILMESSAGE
echo "Subject: $SUBJECT" >> $EMAILMESSAGE
echo "From: $FROM" >> $EMAILMESSAGE
echo "To: $TOO" >> $EMAILMESSAGE
echo "">> $EMAILMESSAGE

#Here is the backup part of the program
#First it makes sure the destination is available
#If not it generates an error and exits.
if [ -d /media/EXTERNAL_1T ] ; then
  date "+Start: %a %b %e %T %Y" >> $EMAILMESSAGE
  rsync -rtD --no-l --no-p --no-g --no-o --stats --chmod=ugo=rwX /home/* /media/EXTERNAL_1T
  #This finalizes the email message and sends it.
  echo "Back up of the home directory was successful" >> $EMAILMESSAGE
  date "+END: %a %b %e %T %Y" >> $EMAILMESSAGE
  echo "" >> $EMAILMESSAGE
  cat $EMAILMESSAGE >> $MBOX
else
  #This finalizes the email message and sends it.
  echo "Error Occured: No directory found to back up to." >> $EMAILMESSAGE
  echo "Possibly not mounted or there is a drive error." >> $EMAILMESSAGE
  cat $EMAILMESSAGE >> $MBOX
fi
rm -f $EMAILMESSAGE 
exit 0
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -6. The time now is 01:53 AM.


© 2007 Novell, Inc. All Rights Reserved.

Search Engine Friendly URLs by vBSEO 3.3.0 RC2