enwise — 2009-12-19T00:43:59-05:00 — #1
Im tryin to figure out the best way to Backup a MySQL and the FTP for a site if possible.. some solutions backup but to the FTP of the site and that doesnt seem to safe :nono:.. what options do I have? I have about 20 sites I would like to automatically backup to another location in case there is a problem with the site so it can be easily restored.. any suggestions?
jeffwalden — 2009-12-19T15:04:05-05:00 — #2
For me I have a cron job that performs a database dump and saves the .sql file to the local file system. On regular intervals I have a scheduled FTP job that moves this .sql file from the local server file system to a remote server for backup.
enwise — 2010-01-02T15:43:06-05:00 — #3
this looks like a great solution.. is this custom or is there somewhere i can find somethin like this?
dan_grossman — 2010-01-02T22:11:48-05:00 — #4
I do the same, but with mysqldump and scp instead of FTP. The main difference is that SCP is secure and doesn't involve sending your passwords and your data over a network in plain text.
It's just a two line bash script, with a few more lines to do rotating dated backups.
enwise — 2010-01-02T22:13:59-05:00 — #5
is there any scripts out there u suggest? i dont know much when it comes to MySQL so all this is new to me
dan_grossman — 2010-01-02T22:17:15-05:00 — #6
1) Look at the manual for mysqldump, and write the command to dump a copy of your database as to a .sql text file
2) Look at the manual for scp, and write the command to send this .sql text file to another server
3) Create a text file with the first command on the first line, and the second command on the second line
4) chmod +x this file to make it executable. Now you can run it at any time to make a backup and send it to your other server.
You can also do it in reverse. Make the backup on the server, but have the other machine initiate the SCP connection to retrieve it -- pull instead of push.
Here's a tutorial on using WinSCP to schedule the download of your backup files from your Windows PC: