HELP! I need a Backup Script to Backup SQL Nightly... [moved]

jeepj27

Registered
Sep 12, 2006
2
0
151
Does anyone know of or can point me to a script that I can use as a Cron Job in CPANEL that will allow me to have a nightly backup of the entire SQL database emailed to me?


Thanks to anyone!!

-John
 

Chew

Well-Known Member
Dec 31, 2003
96
0
156
Maryland
it shouldn't be hard to write a cron job to dump the sql databases via the command line and use some lightweight command line ftp app to send it off.. or it doesn't even have to go anywhere.

I used to have one...
Let me see if I can dig it up.

Chew
 

ujr

Well-Known Member
Mar 19, 2004
290
0
166
and this:

"This script will allow you to maintain a database backup at any time interval you set. When you upload it to your server, you may set it up on a crontab and let it run daily, weekly or monthly. This script connects to your database, builds a backup "dump" file, gzip's it and either sends it to your email address or uploads it to an ftp server that you configured and cleans up the temporary files."

http://www.phpfreaks.com/script/view/11.php
 

lloyd_tennison

Well-Known Member
Mar 12, 2004
698
1
168
If it is only nightly - why can you not simply copy from the Cpanel backup that was already made?

/backup/cpbackup/daily/*/mysql

Has all the mysql databases.

You can rsync them or whatever.
 

dgbaker

Well-Known Member
PartnerNOC
Sep 20, 2002
2,576
9
343
Toronto, Ontario Canada
cPanel Access Level
DataCenter Provider
try

#!/usr/bin/expect -f



set root_pass "123456789"

set hostname "123.45.678.910"



set folder "/backup/cpbackup/daily"



spawn /usr/bin/scp -r $folder [email protected]$hostname:/backup/servername/daily

sleep 3

expect "password: "

sleep 3

send "$root_passr"

interact

Bad idea. Never ever have your root password in plain text.