Skip to content

Instantly share code, notes, and snippets.

@inoryy
Created August 16, 2012 17:54
Show Gist options
  • Save inoryy/3372099 to your computer and use it in GitHub Desktop.
Save inoryy/3372099 to your computer and use it in GitHub Desktop.
Simple database backup & email script
#!/bin/bash
mysqldump <db_name> | gzip > /path/to/backups/<db_name>_`date +'%H-%M_%d-%m-%Y'`.sql.gz
echo "<Project name> database backup" | mutt -s "[Backup] `date +'%H:%M %d-%m-%Y'`" <email@email.com> -a /path/to/backups/$(ls /path/to/backups/ -tr | tail -n 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment