Go Back   cPanel Forums > cPanel® and WHM® (for Linux® and FreeBSD® Servers) > cPanel and WHM Discussions

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-29-2006, 11:43 AM
Registered User
 
Join Date: Nov 2006
Posts: 4
nic_net is on a distinguished road
Post How can i do a database backup using a cron job and send it by mail?

Hello,

I would like to backup only a database (forum.gz) using a cron job and them send the file by mail to a gmail account.

What should I type in the command line ?? Please help me!

I really appreciate it if someone replied .

Thanks

Last edited by nic_net; 11-29-2006 at 12:26 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 11-29-2006, 12:54 PM
Stefaans's Avatar
Registered User
 
Join Date: Mar 2002
Location: Vancouver, Canada
Posts: 443
Stefaans is an unknown quantity at this point
This seems like the script what you are looking for: http://members.lycos.co.uk/wipe_out/automysqlbackup/
__________________
Stephen @ ANNO Internet
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 11-29-2006, 01:35 PM
Registered User
 
Join Date: Nov 2006
Posts: 4
nic_net is on a distinguished road
I do it:

Code:
# Nico backup 1.0
# 29-11-06

# Email donde se enviara
EMAIL="usermail@domain.com"

# Orden de crear el backup
mysqldump --opt -u USERNAME -pPASSWORD DBNAME >>  /home/backups/file1.sql

# Variable fecha
DATE=`date +%Y%m%d`

# De .sql a .gz
gzip file1.sql

# Renombro con la fecha el .gz
mv file1.sql.gz backup-$DATE.sql.gz

# Envio por e-mail
echo 'Aqui tienes el backup de hoy.' | mutt -a backup-$DATE.sql.gz $EMAIL -s "MySQL Backup"

Last edited by nic_net; 11-29-2006 at 01:37 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

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 On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 08:10 AM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© cPanel Inc