Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm looking for something to run locally on my PC, that will login to a server, do a mysql dump, and download it to my PC. Something I can schedule to run daily.

Bonus if it can sync the site's files as well.

Im running Windows 7, linux on the server end. Server in another country.

share|improve this question
    
Good question. I'd love such a tool as well. –  lkessler Oct 28 '09 at 22:11
    
Feel free to give us something to go by. What OS at each end? LAN or WAN? What transport mechanisms are available for the file transfers? –  John Gardeniers Oct 28 '09 at 22:34

5 Answers 5

up vote 1 down vote accepted

Here's the way I do it, with MySQL running on a hosted Linux server and the destination being (currently) a Mac. The method will work just as well with a Windows destination.

  • A cron job on the server runs a script using mysqldump to produce an sql file each night. That file is placed where it can be grabbed remotely. I use wget but this could also be done using SSH if the host alows it.
  • A little while later, long enough to be sure mysqldump has finished, the destination machine downloads the sql file and imports it into a local MySQL server.
  • As a separate operation, the destination machine also synchronises a local copy of the web site using wget. The script that does this then parses the .listing files produced by wget to determine what was actually downloaded. After filtering out stuff I'm not interested in, such as cache files, the results are emailed to me. This way I know if any files have been altered or added. The script also does some other stuff but that's specific to our needs.

The result of all this is that I have local copies of what's on the remote server. In particular, I can create reports locally from the database, which I cannot readily do on the host as the required Perl modules are not available to me and Perl is my preferred reporting tool.

share|improve this answer

You can run mysqldump from your PC. Just use the -h argument and specify the remote MySQL server. Make sure you give the backup user at least SELECT privileges on the database(s) you want to backup from the IP address or subnet.

Cheers

share|improve this answer

You might take a look at SQLyog (non-free).

share|improve this answer

Looking around, I found: Auto Backup for MySQL by SwordSky Software. $50 to $120 depending on edition required.

share|improve this answer

Cygwin for the PC also has the sorts of gnu utils that you're probably used to working with. Windows has cron too, now :)

share|improve this answer
1  
Windows has the task scheduler, so cron is not required. wget runs natively on Windows, as do the MySQL client tools, so Cygwin is not required either. –  John Gardeniers Oct 29 '09 at 9:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.