The Mudcat Café TM
Thread #94834   Message #1844827
Posted By: GUEST,Jon
28-Sep-06 - 06:07 AM
Thread Name: Tech: Error 503 Service Unavailable
Subject: RE: Tech: Error 503 Service Unavailable
As a point of interest which I suppose could be of use to someone here. While I don't have vast amounts of data, I do have the backing up, etc. needs.

My situation is that I have 2 machines, one I run purely as a web server which is permanatly on. The other is my general purpose machine, which I use for development, browsing the internet or anything else. This machine may be on or off but I want to get a regular backup of my databases there where I can do whatever I may want with it at my leisure. What I do is schedule regular cron (read task manager for win) jobs to run this script on the server:

when=`date +%Y-%m-%d_%H:%M:%S`
filename="/backups/"$1"_"$when".bz2"
mysqldump $1 -h$2 -u$3 -p$4 | bzip2 -c >$filename
mail -s$1" backup" -a $filename jon < /dev/null
rm $filename

This script takes the details of the database I wish to back up, performs the backup, which it then "zips" to a file named with the database and the date/time of the backup. It then emails me the backup. When I start my general purpose machine up in the morning and check my email, I recieve the back ups that were taken in the early hours of the morning as email attachments.