Automated DB backup and FTP

Status
Not open for further replies.

Time

Active Member
239
2010
31
0
I'm running a CentOS 5 Dedicated Server (no control panel, preferably won't install one).

I'm wanting to be able to have a automated MySQL database backup every 12 hours and uploaded to a VPS via FTP, how would I be able to do that?

Thanks.
 
Last edited:
9 comments
are you using any scripts?
in vbulletin theres a plugin which takes an automatic backup then later on you can ftp that backup or transfer it to another server but im not sure on how you would go about making it go straight ftp etc
 
Well I would do this with a cron job executing every 12 hours and a small bash script:
Code:
#! /bin/bash
mysqldump -u username -h localhost -p password database_name | gzip -9 > backup_db.sql.gz
wput backup_db.sql.gz ftp://user:pass@host
First line does a Backup of your database and compresses it.
Second line uploads compressed file to another server via ftp.

KaFo
 
@KaFo * true if he knows he has to do it. :)

@Whoo * I am assuming he wants it offsite somewhere. Not on the same server.

He could scp instead of ftp or wput or ?? Just what a person knows that make them feel comfortable.
 
Status
Not open for further replies.
Back
Top