Increase network connections to B2

This commit is contained in:
Erik Westrup
2018-11-24 13:27:59 +01:00
parent 380eea0f6c
commit ba732cb238
2 changed files with 8 additions and 1 deletions

View File

@@ -31,6 +31,8 @@ BACKUP_TAG=systemd.timer
# B2_ACCOUNT_ID, B2_ACCOUNT_KEY, RESTIC_REPOSITORY etc.
source /etc/restic/b2_env.sh
# How many network connections to set up to B2. Default is 5.
B2_CONNECTIONS=50
# NOTE start all commands in background and wait for them to finish.
# Reason: bash ignores any signals while child process is executing and thus my trap exit hook is not triggered.
@@ -49,6 +51,7 @@ restic backup \
--verbose \
--one-file-system \
--tag $BACKUP_TAG \
--option b2.connections=$B2_CONNECTIONS \
$BACKUP_EXCLUDES \
$BACKUP_PATHS &
wait $!
@@ -69,6 +72,7 @@ wait $!
# Remove old data not linked anymore.
# See restic-prune(1) or http://restic.readthedocs.io/en/latest/060_forget.html
restic prune \
--option b2.connections=$B2_CONNECTIONS \
--verbose &
wait $!

View File

@@ -16,9 +16,11 @@ exit_hook() {
trap exit_hook INT TERM
source /etc/restic/b2_env.sh
# How many network connections to set up to B2. Default is 5.
B2_CONNECTIONS=50
# Remove locks from other stale processes to keep the automated backup running.
# NOTE nope, dont' unlock liek restic_backup.sh. restic_backup.sh should take preceedance over this script.
#restic unlock &
@@ -26,5 +28,6 @@ source /etc/restic/b2_env.sh
# Check repository for errors.
restic check \
--option b2.connections=$B2_CONNECTIONS \
--verbose &
wait $!