Register
It is currently Fri Jul 25, 2014 2:39 pm

sending email from bash script


All times are UTC - 6 hours


Post new topic Reply to topic  [ 2 posts ] 
Author Message
 PostPosted: Mon May 16, 2005 10:59 am   
Site Admin
User avatar

Joined: Sun May 15, 2005 9:36 pm
Posts: 662
Location: Des Moines, Iowa
Not really a backup script..... but deals with email

Depending on what you want to send,

This sends the file named emails.txt (or any file you designate)
Code:
cat /var/www/html/emails.txt | mail -s "This is a test" youremail@email.com


This sends the last 100 lines of an Apache log file.
Code:
tail -100 /var/log/httpd/site_access_log | mail -s "Apache Log File" youremail@email.com


This sends the current listing of a directory
Code:
ls /var/www/html/ | mail -s "This is a test" youremail@email.com


Top
 Profile WWW  
 PostPosted: Sun May 22, 2005 8:55 am   
User avatar

Joined: Wed May 18, 2005 5:32 am
Posts: 4
Location: Australia
if you want to use it as backup,
you can enhance it with mutt :)


Top
 Profile WWW  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Google [Bot] and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP