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




*
To prove you're a person (not a spam script), type the security word shown in the picture.
Anti-spam image


Directory of Personal Blogs
Technology Blogs - BlogCatalog Blog Directory Personal - Top Blogs Philippines