backup

Copy and Uncompress (ssh, gunzip, tar) from Remote Server

So you have a remote backup and you want to quickly have it restored locally or to another server without transferring, then uncompressing as 2 or 3 steps.

ssh user@remote-server "cat /path/to/compressed/backup.tar.gz" | tar xzvf -

Tags: , , , , , ,

Sunday, June 26th, 2011 Linux, Networking, Unix No Comments

Quick Backup of All MySQL Databases

Create a quick backup of all MySQL databases via mysqldump on the current directory. Replace USERNAME and PASSWORD with your own.

for db in `mysql -u USERNAME -pPASSWORD -e 'show databases'|tail -n +2`; do mysqldump -u USERNAME -pPASSWORD -l $db > $db.sql; done;

Tags: , ,

Saturday, October 17th, 2009 Bash, Linux, Mac, MySQL, Unix No Comments