this is what i edited , it takes backups and send it to email. DBNAME=dbname DBPASS=dbpass DBUSER=dpuser #Keep the " around your address EMAIL="u@uuu.com" mysqldump --opt -u $DBUSER -p$DBPASS $DBNAME > backup.sql gzip backup.sql DATE=`date +%Y%m%d` ; mv backup.sql.gz $DBNAME-backup-$DATE.sql.gz echo 'Your mySQL Backup is attached' | mutt -a $DBNAME-backup-$DATE.sql.gz $EMAIL -s "MySQL Backup" set up a corn job for it for 24 hours
similar to the previous post but instead of emailing it you can scp it (same as ftp but safer) over to another machine: example: scp backup.sql you could timestamp the names to keep a nice historical repository
Also, over on PHPClasses there's a fairly new class for doing db backups... phpclasses dot org / browse / package / 4421.html Sorry... apparently I haven't posted enough to leave a live link yet so just get rid of the spaces and the dot of course.