Backup Mysql via ssh Compressing with GZip

Error message

Deprecated function: Function create_function() is deprecated in GeSHi->_optimize_regexp_list_tokens_to_string() (line 4698 of /home/projects/peter-j-lord/sites/all/libraries/geshi/geshi.php).
Rating: 
+1
+144
-1
Clone this Snippet

I have a Linode vertual server and was running out of diskspace. So here's a onliner bash command which pipes the output of a 'mysqldump' to a gzip and then ssh out over to another server to backup.

The -c on the gzip tell it to send over to stdout

mysqldump -uUSERNAME -pPASSWORD DATABASE | gzip -c | ssh USERNAME@HOST 'cat > ~/dump.sql.gz
Category: 
Bash