Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- REPOSITORY=user@IP:/path/to/share
- TARGET="/mount/point"
- export BORG_PASSPHRASE="PASSPHRASE"
- hostname=$(hostname)
- date=$(date +%Y-%m-%d)
- echo "Mounting..."
- sshfs $REPOSITORY $TARGET
- if [ "$1" == "-p" ]; then
- echo "Creating..."
- borg create -v --progress --stats --compression zlib,9 $TARGET::$hostname-$date $HOME --exclude '/home/*/.cache' --exclude '/home/*/.btsync'
- else
- echo "Creating..."
- borg create -v --stats --compression zlib,9 $TARGET::$hostname-$date $HOME --exclude '/home/*/.cache' --exclude '/home/*/.btsync'
- fi
- echo "Pruning..."
- borg prune -v $TARGET --prefix $hostname- --keep-daily=7 --keep-weekly=4 --keep-monthly=6
- echo "Unmounting..."
- sleep 10; fusermount -u $TARGET
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement