View Single Post
Old 2005-07-28, 08:17 PM   #2
cd34
a.k.a. Sparky
 
cd34's Avatar
 
Join Date: Sep 2004
Location: West Palm Beach, FL, USA
Posts: 2,396
crontab entry:

0 1 * * 1,3,5 /usr/bin/mysqldump -q -u username -p"password" databasename > /tmp/file.sql;gzip /tmp/file.sql;/var/www/email.pl

email.pl
Code:
#!/usr/bin/perl -w

use MIME::Lite;

$msg = MIME::Lite->new(

From => 'user@domain.com',
To => 'user@domain.com',
Subject => 'mysql backup',
Type => 'text/plain',
Data => "backups attached");

$msg->attach(Type=>'application/x-tar',
Path =>"/tmp/file.sql.gz",
Filename =>"file.sql.gz");

$msg->send;
__________________
SnapReplay.com a different way to share photos - iPhone & Android
cd34 is offline   Reply With Quote