Quick and Dirty Mysql backup to Samba share
Posted on April 18, 2008
#mount the samba share
mount -t smbfs -o username=<username>,password=<password> //server/share /mnt/database
#backup database
for i in $(mysql-uroot -password -e "SHOW DATABASES"|tail +2); do mysqldump -uroot -ppassword $i | gzip -9 > /mnt/database/$i.sql.gz; done
#unmount the samba share
umount /mnt/database
» Filed Under Linux/Nix
Comments
Leave a Reply


