Skip to content

Instantly share code, notes, and snippets.

@lakhbawa
Last active October 10, 2020 14:09
Show Gist options
  • Save lakhbawa/be2d79ea55386ef5f3e6dc4e71877cfe to your computer and use it in GitHub Desktop.
Save lakhbawa/be2d79ea55386ef5f3e6dc4e71877cfe to your computer and use it in GitHub Desktop.
Mysql backup database from Running Container with Time and Date
# Backup the Database
docker exec CONTAINER mkdir -p /backups | mysqldump -u root --password='PASSWORD_HERE' DATEBASE_NAME_HERE | gzip > /backups/backup_DATABASE_NAME_$(date +%Y_%m_%d__%H_%M_%S).sql.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment