Skip to content

Commit

Permalink
Add stats (bucket utilization) to nc-restic-s3-backup
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasheller committed Nov 1, 2021
1 parent d1bf872 commit f2b9fe7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions bin/ncp/BACKUPS/nc-restic-s3-backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,16 @@ configure()
echo "notice: backup has completed anyways"
return 12
}

echo "gathering stats (How much space do the backups take up in the S3 bucket?) ..."

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 stats --mode raw-data || {
echo "error: restic stats failed"
echo "notice: backup has completed anyways"
return 13
}

echo "backup complete"
}

# License
Expand Down

0 comments on commit f2b9fe7

Please sign in to comment.