Skip to content

Instantly share code, notes, and snippets.

@totojack
Created January 16, 2017 20:14
Show Gist options
  • Save totojack/892321adba4594d147a86407e16bcda0 to your computer and use it in GitHub Desktop.
Save totojack/892321adba4594d147a86407e16bcda0 to your computer and use it in GitHub Desktop.
docker container files backup
#mysqldump
docker exec CONTAINER sh -c 'exec mysqldump -u BKPUSER -pBKPPWD -h localhost DATABASE' | $GZIP -9 > $NOW.gz
#tar gz
docker cp CONTAINER:/custom/dir - | gzip > $FILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment