The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
need assistance ----SH schell script shahidbakshi Shell Programming and Scripting 2 02-22-2008 03:28 AM
I need an assistance mytilini boy Shell Programming and Scripting 1 05-25-2007 05:42 PM
KSH Script Assistance Brusimm Shell Programming and Scripting 3 05-10-2007 05:15 AM
Perl script assistance; paste word into external command bru Shell Programming and Scripting 10 02-23-2007 01:04 AM
Interpreting a script line by line assistance mdpgc Shell Programming and Scripting 0 02-21-2007 08:57 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 02-03-2008
Registered User
 

Join Date: Feb 2008
Posts: 3
Need a little assistance with a shell script

I need to modify a script to send an attatched file. I have researched and read the faq's but have not found a solution for my script. Here is a copy of the code I am using:
Code:
#!/bin/sh


mysqldump --opt --skip-add-locks --user=****** --password=******* databasename | gzip > /home/******/backups/Databasename_`date "+%Y-%m-%d"`.gz
cd /home/*****/backups/
find *.gz -mtime +7 -exec rm -rf {} \;
This script copies the database and saves it to the "backups" file and deletes the files older than 7 days. I would like to add code to email the gziped file to an email account also.

Any help is greatly appreciated.
Reply With Quote
Forum Sponsor
  #2  
Old 02-03-2008
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,610
Didn't this help ?

Need to attach a txt file while sending mail
Reply With Quote
  #3  
Old 02-04-2008
Registered User
 

Join Date: Feb 2008
Posts: 3
Quote:
Originally Posted by matrixmadhan View Post
I am not a coder, so was not sure how I could incorporate it....
Reply With Quote
  #4  
Old 02-04-2008
Registered User
 

Join Date: Feb 2008
Posts: 3
Quote:
Originally Posted by matrixmadhan View Post
I read over that post again, and still can not find what I need.

What I want to do is incorporate in the code I posted above, to send the file to my email as well as save it to the backups file as is coded.
The problem I have with suggested examples is that they all specify a specific file. The code above generates a new file with a different name everyday, and that is where I have the hang up.

Thanks for your help in this.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 06:50 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0