View Single Post
Old November 22nd, 2005, 09:56 PM   #9 (permalink)
Axe
Member
Verified Customer
 
Join Date: Dec 2002
Posts: 52
Just wanted to add this in case any of you were interested, I just use mysqldump from the command line in a cron job to backup my database, and I have another cron job running locally on a Linux laptop here to download it...

This is the sqlbackup.sh file on the server..

Code:
Content visible to verified customers only.
Remember to set your permissions accordingly so that other users on the system (for you shared hosting folks) can't view it and see your SQL passwords n' whatnot, but make sure you set it executable.

I put it into a .htaccess password protected directory...

Then on the Linux laptop I'm running this script (which is scheduled to run about an hour after the one above)..
Code:
Content visible to verified customers only.
  • database_username == The database username
  • database_password == Your database user's password
  • database_name == The name of the database
  • /home/your_home_dir/public_html/backup/ == (1st chunk of code) The appropriately protected directory on your server
  • htaccess_user == The username of the .htaccess protected directory
  • htaccess_password == The password for the .htaccess protected user account you picked above
  • /home/your_home_dir/ == (2nd chunk of code) The desired directory to which you wish to download & extract locally
I gzip because the .sql file created by the server is about 950Meg, and that'd take a while. Gzipped it's around 59Meg or so.

If you're running Windows locally, and just want to keep a backup (aren't bothered about mirroring your site on a local development/test machine - which is why I have it going straight to my Linux laptop), you should be able to download (even with the .htaccess protection) using the Micro$oft Scheduler that comes with Windows.
Axe is offline   Reply With Quote