Guest User

Untitled

a guest
May 19th, 2018
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. #check if servershare is mounted
  4. if [ ! -f /mnt/backup/donotdelete ]
  5. then
  6. mount -t smbfs -o username=foo,password=bar//server/backup /mnt/backup
  7. fi
  8.  
  9. # get backup
  10. /usr/bin/rdiff-backup --exclude /mnt --exclude /home/backup --exclude /proc --exclude /sys --exclude /var/run --exclude /tmp / /home/backup/local-backup
  11.  
  12. # delete old backups, tar.gz the new one
  13. cd /home/backup
  14. rm -rf /mnt/backup/backup-*.tar.gz
  15. tar -cvzPf /mnt/backup/backup-`date "+%s"`.tar.gz local-backup/
  16. cd /
  17.  
  18. umount /mnt/backup
Add Comment
Please, Sign In to add comment