Skip to content

Instantly share code, notes, and snippets.

@liaol
Created April 24, 2015 06:46
Show Gist options
  • Save liaol/202b2b497ad5d0d0d232 to your computer and use it in GitHub Desktop.
Save liaol/202b2b497ad5d0d0d232 to your computer and use it in GitHub Desktop.
backup mysql daily
#!/bin/bash
database=""
user=""
password=""
filename="$database-`date +'%Y%m%d'`"
dir=/root/mysqlbak/$database
/usr/bin/mysqldump --opt $database -u$user -p$password > $dir/$filename.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment