Skip to content

Instantly share code, notes, and snippets.

@strangerstudios
Last active March 21, 2018 15:02
Show Gist options
  • Save strangerstudios/e1a93f7fc71166b2bd12 to your computer and use it in GitHub Desktop.
Save strangerstudios/e1a93f7fc71166b2bd12 to your computer and use it in GitHub Desktop.
Shell script to backup and gzip your database.
#change the username, password, and database names below.
mysqldump -uusername -ppassword database > database_`date +'%Y-%m-%d'`.sql
gzip database_`date +'%Y-%m-%d'`.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment