Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- EXCLUDE_REGEX='(cache|sess).+[a-z0-9]{26,}|_log$|\.log(.gz)?$'
- GLOBAL_ARGS="--skipNewer --keepDays 30 --threads 17 --excludeRegex $EXCLUDE_REGEX"
- # usage example :
- #
- # ./backup-b2 $ACCOUNT_ID $APPLICATION_KEY << EOF
- # /var/www/html b2://mybucket/mysite
- # /etc/ssl b2://mybucket/mycerts
- # EOF
- #
- # ./backup-b2 < mybuckets.txt
- ###########
- lock=/run/lock/b2backup
- if [ -f "$lock" ]
- then
- exit 0
- fi
- touch "$lock"
- trap "rm \"$lock\"" EXIT
- b2 authorize-account $@ || exit 1
- while read -r A
- do
- if [[ "$A" == "" ]]
- then
- continue
- fi
- ionice -n7 nice -n 20 b2 sync $GLOBAL_ARGS $A
- done
Add Comment
Please, Sign In to add comment