Guest User

Untitled

a guest
Sep 18th, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. user=person
  4. password=secret
  5. db=mydb
  6. rmfile=`date --date '7 days ago' +mydb.%F.sql`
  7. addfile=`date +mydb.%F.sql`
  8.  
  9. mysqldump -u $user -p$password $db > /tmp/mydb.sql
  10.  
  11. cd /tmp
  12.  
  13. tarsnap -d -f $rmfile
  14. tarsnap -c -f $addfile mydb.sql
  15.  
  16. rm /tmp/mydb.sql
Add Comment
Please, Sign In to add comment