From f4d5d942928ad0d929356059a40ab5dac0690cf1 Mon Sep 17 00:00:00 2001 From: Robert Ames Date: Sat, 24 Feb 2024 08:36:03 -0600 Subject: [PATCH] Updated restic with SeaweedFS (markdown) --- restic-with-SeaweedFS.md | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/restic-with-SeaweedFS.md b/restic-with-SeaweedFS.md index 6d4ff3c..347b898 100644 --- a/restic-with-SeaweedFS.md +++ b/restic-with-SeaweedFS.md @@ -3,14 +3,31 @@ See https://restic.github.io On mac: `brew install restic` -### Configuration -Set these environment variables. The key values do not matter. +### Weed Configuration + +Set the `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` environment variables in both your `weed` environment as well as your `restic` environment. + +The key values do not matter _but they must be provided_, as `restic` expects (and effectively requires) non-anonymous access when communicating with an S3 bucket. + +This may involve configuring your `weed` server similar to the following: + ```bash -export AWS_ACCESS_KEY_ID=any-key-id -export AWS_SECRET_ACCESS_KEY=any-access-key +export AWS_ACCESS_KEY_ID="any-key-id" +export AWS_SECRET_ACCESS_KEY="any-access-key" + +export WEED_S3_CONFIGURE_CMD="s3.configure \ + -access_key \"$AWS_ACCESS_KEY_ID\" \ + -secret_key \"$AWS_SECRET_ACCESS_KEY\" \ + -user iam \ + -actions Admin \ + -apply" +echo "$WEED_S3_CONFIGURE_CMD" | weed shell ``` -### Execute commands +### Execute Restic Commands + +See: https://github.com/seaweedfs/seaweedfs/wiki/s3cmd-with-SeaweedFS + First, create the bucket: ```bash s3cmd mb s3://resticbucket @@ -18,6 +35,9 @@ s3cmd mb s3://resticbucket Then, initialize the restic bucket and backup to it: ```console +$ export AWS_ACCESS_KEY_ID="any-key-id" +$ export AWS_SECRET_ACCESS_KEY="any-access-key" + $ restic -r s3:http://localhost:8333/resticbucket init $ restic -r s3:http://localhost:8333/resticbucket backup /Users/chris/dev/gopath/bin/