Skip to content

Commit

Permalink
nc-restic-s3-backup: exclude files (opcache)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasheller committed Nov 1, 2021
1 parent f2b9fe7 commit bd6d9e7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions bin/ncp/BACKUPS/nc-restic-s3-backup.sh
Expand Up @@ -19,6 +19,8 @@ install()

configure()
{
local start=$(date +%s)

[[ "$S3_BUCKET_URL" == "" ]] && {
echo "error: please specify S3 bucket URL"
return 1
Expand Down Expand Up @@ -62,7 +64,10 @@ configure()

echo "backing up from $DATADIR"

AWS_ACCESS_KEY_ID="$S3_KEY_ID" AWS_SECRET_ACCESS_KEY="$S3_SECRET_KEY" RESTIC_PASSWORD="$RESTIC_PASSWORD" restic -r "s3:$S3_BUCKET_URL/ncp-backup" --verbose backup . || {
AWS_ACCESS_KEY_ID="$S3_KEY_ID" AWS_SECRET_ACCESS_KEY="$S3_SECRET_KEY" RESTIC_PASSWORD="$RESTIC_PASSWORD" restic -r "s3:$S3_BUCKET_URL/ncp-backup" --verbose --exclude-file=/dev/stdin backup . <<EXCLUDES_LIST
.opcache
EXCLUDES_LIST
[[ $? -eq 0 ]] || {
echo "error: restic backup failed"
echo "notice: use nc-maintenance to disable maintenance mode anyway if desired"
return 9
Expand Down Expand Up @@ -110,7 +115,9 @@ configure()
return 13
}

echo "backup complete"
local end=$(date +%s)

echo "backup complete after $((($end-$start)/60)) minute(s)"
}

# License
Expand Down

0 comments on commit bd6d9e7

Please sign in to comment.