Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- user=person
- password=secret
- db=mydb
- rmfile=`date --date '7 days ago' +mydb.%F.sql`
- addfile=`date +mydb.%F.sql`
- mysqldump -u $user -p$password $db > /tmp/mydb.sql
- cd /tmp
- tarsnap -d -f $rmfile
- tarsnap -c -f $addfile mydb.sql
- rm /tmp/mydb.sql
Add Comment
Please, Sign In to add comment