I have the following:
 mysqldump -u xxxx 
           -h localhost 
           --password=xxxxx databasename | 
           ssh [email protected] "dd of=httpdocs/backup`date +'%Y-%m-%d-%H-%M-%S'`.sql"
...which SSH's a mysqldump to a remote machine.
I need to compress the mysqldump before it is SSH'd as the dump is 500mb and its eating up my bandwidth allowance.
mysqldump ... | gzip -9 | ssh ...
or
mysqldump ... | bzip2 -9 | ssh ...
or, if you want it uncompressed on the other end
mysqldump ... | bzip2 -9 | ssh machine "bzip2 -d >..."
mysqldump ... | gzip -9 | ssh machine "gzip -d >..."
You can add the -C flag to the ssh call to automatically compress the transmitted data.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With