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

  • Recent Comments

    • krusna: the file SUNWrge.tar.gz is not found on that URL....
    • Gugi: The file SUNWrge.tar.gz is not found on the url you gave abo...
    • Robert: how can i take a slot in your blog-rolls? here's mind htt...
    • rachel Perez: that's mine, mine, mine, mine... hehe.. thanks po......
    • Malyn Torne: gada voice nya at ang humble nya para sa mga tao..keep up th...

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