May 28, 2023

Scaleway GLACIER class object storage with restic

I’m starting to use C14’s GLACIER storage class with restic, and until now it seems be working very well.

I suggest to create the repository in the usual way with restic -r init, which will create the config file and keys in the STANDARD storage class. For backups, I’m using the command:

$ restic backup -r -o --host host /path

similar to what you did, apart the option is and not storage-class.

In this way files in the data and snapshots directories are in GLACIER storage class, and you can add backups with no problem. I can also mount the repository while data is in GLACIER class (I suppose all the info are taken from cache) so I can do restic mount /mnt/c14 and I can browse the files, also if I cannot copy them or see their content.

If I need to restore files, I restore all bucket in STANDARD class with s3cmd restore --recursive s3://test-bucket/ (see s3cmd), I test that all files are correctly in standard class with:

$ aws s3 ls s3://test-bucket --recursive | tr -s ' ' | cut -d' ' -f 4 | xargs -n 1 -I {} sh -c "aws s3api head-object --bucket unitedhost --key '{}' | jq -r .StorageClass" | grep --quiet GLACIER

which returns true if at least one file is in GLACIER class, so you have to wait this command to returns false.

Obviously a restore will need more time, but I’m using C14 glacier as a second or third backup, while using another restic repository in Backblaze B2 which is a warm storage.

Leave a Reply