Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #check if servershare is mounted
- if [ ! -f /mnt/backup/donotdelete ]
- then
- mount -t smbfs -o username=foo,password=bar//server/backup /mnt/backup
- fi
- # get backup
- /usr/bin/rdiff-backup --exclude /mnt --exclude /home/backup --exclude /proc --exclude /sys --exclude /var/run --exclude /tmp / /home/backup/local-backup
- # delete old backups, tar.gz the new one
- cd /home/backup
- rm -rf /mnt/backup/backup-*.tar.gz
- tar -cvzPf /mnt/backup/backup-`date "+%s"`.tar.gz local-backup/
- cd /
- umount /mnt/backup
Add Comment
Please, Sign In to add comment