Skip to content

Instantly share code, notes, and snippets.

@samuelpismel
Created November 6, 2015 17:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samuelpismel/6c535bb6fa3e8a9950ad to your computer and use it in GitHub Desktop.
Save samuelpismel/6c535bb6fa3e8a9950ad to your computer and use it in GitHub Desktop.
gziped mysql dumps with timestamp on filename
#!/bin/bash
database='my_database_name'
username='database_username'
password='database_password'
mysqldump $database -u $username -p"$password" | gzip > "dumps/$database-$(date +%F--%H-%m-%S).sql.gz"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment