Add the admin account as `deuxfleurs` to your `~/.mc/config` file You need to choose some names/identifiers: ```bash export ENDPOINT="https://s3.garage.tld" export SERVICE_NAME="example" export BUCKET_NAME="backups-${SERVICE_NAME}" export NEW_ACCESS_KEY_ID="key-${SERVICE_NAME}" export NEW_SECRET_ACCESS_KEY=$(openssl rand -base64 32) export POLICY_NAME="policy-$BUCKET_NAME" ``` Create a new bucket: ```bash mc mb deuxfleurs/$BUCKET_NAME ``` Create a new user: ```bash mc admin user add deuxfleurs $NEW_ACCESS_KEY_ID $NEW_SECRET_ACCESS_KEY ``` Add this new user to your `~/.mc/config.json`, run this command before to generate the snippet to copy/paste: ``` cat > /dev/stdout < /tmp/policy.json </secrets/`: ```bash echo "USER Backup AWS access key ID" > backup_aws_access_key_id echo "USER Backup AWS secret access key" > backup_aws_secret_access_key echo "USER Restic repository, eg. s3:https://s3.garage.tld" > backup_restic_repository echo "USER Restic password to encrypt backups" > backup_restic_password ``` Then run secretmgr: ```bash # Spawning a nix shell is an easy way to get all the dependencies you need nix-shell # Check that secretmgr works for you python3 secretmgr.py check # Now interactively feed the secrets python3 secretmgr.py gen ``` --- Now we need a service that runs: ``` restic backup . ``` And also that garbage collect snapshots. I propose: ``` restic forget --prune --keep-within 1m1d --keep-within-weekly 3m --keep-within-monthly 1y ```