Skip to content

Instantly share code, notes, and snippets.

@mrmuminov
Last active April 2, 2021 06:07
Show Gist options
  • Save mrmuminov/c82c0b6b81a9f581a1d7f04dbba8206c to your computer and use it in GitHub Desktop.
Save mrmuminov/c82c0b6b81a9f581a1d7f04dbba8206c to your computer and use it in GitHub Desktop.
Remote backup of PostgreSQL, MySQL via SSH
***
*** of PostgreSQL
ssh user@host "pg_dump -U db_user -h localhost -C --column-inserts" \ > dblocal.sql.gz
*** of MySQL
ssh user@host "mysqldump -u db_user -p db_name | gzip -9" > dblocal.sql.gz
***
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment