diff --git a/templates/resticTemplate.sh b/templates/resticTemplate.sh index 3484b54..ae6ddc3 100644 --- a/templates/resticTemplate.sh +++ b/templates/resticTemplate.sh @@ -1,9 +1,23 @@ #!/bin/bash -restic backup --verbose \ - --tag "${RESTIC_TAG_01}" --tag "${RESTIC_TAG_02}" \ - --exclude-caches \ - --exclude-file="${RESTIC_EXCLUDES}" \ - --exclude "${SCRIPT_DIR}"/variables.sh \ - --exclude "${SCRIPT_DIR}"/variablesAWS.sh \ - "${RESTIC_SOURCE}" \ No newline at end of file +if [ AWS_RESTIC_BACKUP = 'no' ]; then + restic backup --verbose \ + --tag "${RESTIC_TAG_01}" --tag "${RESTIC_TAG_02}" \ + --exclude-caches \ + --exclude-file="${RESTIC_EXCLUDES}" \ + --exclude "${SCRIPT_DIR}"/variables.sh \ + --exclude "${SCRIPT_DIR}"/variablesAWS.sh \ + "${RESTIC_SOURCE}" +fi + +if [ AWS_RESTIC_BACKUP = 'yes' ]; then + restic backup --verbose \ + --tag "${RESTIC_TAG_01}" --tag "${RESTIC_TAG_02}" \ + --exclude-caches \ + --exclude-file="${RESTIC_EXCLUDES}" \ + --exclude "${SCRIPT_DIR}"/variables.sh \ + --exclude "${SCRIPT_DIR}"/variablesAWS.sh \ + -o s3.connections="${AWS_CONNECTIONS}" \ + --limit-upload "${AWS_UPLOAD}" \ + "${RESTIC_SOURCE}" +fi \ No newline at end of file diff --git a/templates/variablesAWSTemplate.sh b/templates/variablesAWSTemplate.sh index 0c5e8c5..13af4bd 100644 --- a/templates/variablesAWSTemplate.sh +++ b/templates/variablesAWSTemplate.sh @@ -14,6 +14,8 @@ export RESTIC_REPOSITORY='/path/to/repo' export AWS_ACCESS_KEY_ID='KEY-ID' export AWS_SECRET_ACCESS_KEY='SECRET-KEY' +# readonly AWS_CONNECTIONS='2' +# readonly AWS_UPLOAD='2440' export RESTIC_PASSWORD='PASSWORD' readonly RESTIC_SOURCE='/path/to/dir/to/backup' diff --git a/templates/variablesTemplate.sh b/templates/variablesTemplate.sh index 13e2f50..9c5beef 100644 --- a/templates/variablesTemplate.sh +++ b/templates/variablesTemplate.sh @@ -79,6 +79,8 @@ readonly LOG_RETENTION='30' ## Only set these if backing up to a compatible repo # export AWS_ACCESS_KEY_ID='KEY-ID' # export AWS_SECRET_ACCESS_KEY='SECRET-KEY' +# readonly AWS_CONNECTIONS='2' +# readonly AWS_UPLOAD='2440' ## Set these for all restic configurations # export RESTIC_REPOSITORY='/path/to/repo'