Skip to content

Instantly share code, notes, and snippets.

@sdesalas
Created May 22, 2022 17:35
Show Gist options
  • Save sdesalas/b16defd5f087b5da3dd68d78ac900367 to your computer and use it in GitHub Desktop.
Save sdesalas/b16defd5f087b5da3dd68d78ac900367 to your computer and use it in GitHub Desktop.
Db backup scripts
for DB in $(mysql -u root -p<password> -h <IP of DB> -e 'show databases' -s --skip-column-names); do
mysqldump -u root -p<password> -h<IP of DB> $DB > "$DB.sql";
@sdesalas
Copy link
Author

I like to mysqldump | gzip --rsyncable | restic --stdin

works great, deduplicated snapshot directly into a cloud bucket

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment