Scaleway GLACIER class object 存储与 restic
Scaleway GLACIER class object storage with restic
Scaleway recently launched GLACIER class storage "C14 Cold Storage Class
他们有一个很棒的免费 75GB 计划,我想使用 restic 备份工具来利用它。
为了使这项工作正常进行,我已成功按照 S3 说明创建和上传存储库,但有一点需要注意。我无法成功通过 storage-class header as GLACIER。
使用 awscliv2,我可以成功地从我的本地机器上传递一个看起来非常像这样的 header:aws s3 cp object s3://bucket/ --storage-class GLACIER
但是对于 restic,在研究了一些 github 问题后,我可以看到 an option 传递了一个 -o
标志。链接的问题解决方案对我来说不是那么清楚,所以我尝试了以下 restic 命令,但没有成功看到 Scaleway 存储桶控制台中文件 objects 旁边的存储标签 "GLACIER" class:
restic -r s3:s3.fr-par.scw.cloud/restic-testing -o GLACIER --verbose backup ~/test.txt
restic -r s3:s3.fr-par.scw.cloud/restic-testing -o storage-class=GLACIER --verbose backup ~/test.txt
有人可以提出其他选择吗?
我开始将 C14 的 GLACIER 存储 class 与 restic 一起使用,直到现在它似乎工作得很好。
我建议以通常的方式使用 restic -r s3:s3.fr-par.scw.cloud/test-bucket init
创建存储库,这将在标准存储 class 中创建 config
文件和密钥。
对于备份,我使用命令:
$ restic backup -r s3:s3.fr-par.scw.cloud/test-bucket -o s3.storage-class=GLACIER --host host /path
与您所做的类似,除了选项是 s3.storage-class
而不是 storage-class
。
这样 data
和 snapshots
目录中的文件在 GLACIER 存储 class 中,您可以毫无问题地添加备份。
我还可以在数据位于 GLACIER class 中时挂载存储库(我想所有信息都来自缓存)所以我可以 restic mount /mnt/c14
并且我可以浏览文件,即使我无法复制它们或查看他们的内容。
如果我需要恢复文件,我用 s3cmd restore --recursive s3://test-bucket/
恢复标准 class 中的所有存储桶(参见 s3cmd),我测试所有文件在标准 [=35] 中是否正确=] 与:
$ 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
如果 GLACIER class 中至少有一个文件,则 returns 为真,因此您必须等待此命令 returns 为假。
显然恢复需要更多时间,但我使用 C14 glacier 作为第二或第三个备份,同时在 Backblaze B2 中使用另一个 restic 存储库,它是一个温暖的存储。
除了 vstefanoxx 's : 这是我的工作流程。
我像 vstefanoxx 一样设置了 restic 存储库。
现在,如果您想 修剪 存储库...您不能,因为文件在 glacier
中并且 restic
需要读写权限到要修剪的桶。
Scaleway 的有趣之处在于 glacier
和 standard
class 之间的文件传输是免费的。因此,让我们将数据移回标准 class :
s3cmd restore --recursive s3://test-bucket
然后使用 vstefanoxx 给出的命令等到过程结束。一旦您的数据达到标准 class,您的成本就会增加五倍,因此我们必须高效:-)
所以我们现在修剪存储库:
restic prune -r s3:s3.fr-par.scw.cloud/test-bucket
完成后,将所有内容(实际上是 data, index
和 snapshots
但 不是 keys
)移回冰川:
s3cmd cp s3://test-bucket/data/ s3://test-bucket/data/ --recursive --storage-class=GLACIER
s3cmd cp s3://test-bucket/index/ s3://test-bucket/index/ --recursive --storage-class=GLACIER
s3cmd cp s3://test-bucket/snapshots/ s3://test-bucket/snapshots/ --recursive --storage-class=GLACIER
所以我们现在已经到了修剪存储库的地步,试图支付最少的钱!
Scaleway recently launched GLACIER class storage "C14 Cold Storage Class
他们有一个很棒的免费 75GB 计划,我想使用 restic 备份工具来利用它。
为了使这项工作正常进行,我已成功按照 S3 说明创建和上传存储库,但有一点需要注意。我无法成功通过 storage-class header as GLACIER。
使用 awscliv2,我可以成功地从我的本地机器上传递一个看起来非常像这样的 header:aws s3 cp object s3://bucket/ --storage-class GLACIER
但是对于 restic,在研究了一些 github 问题后,我可以看到 an option 传递了一个 -o
标志。链接的问题解决方案对我来说不是那么清楚,所以我尝试了以下 restic 命令,但没有成功看到 Scaleway 存储桶控制台中文件 objects 旁边的存储标签 "GLACIER" class:
restic -r s3:s3.fr-par.scw.cloud/restic-testing -o GLACIER --verbose backup ~/test.txt
restic -r s3:s3.fr-par.scw.cloud/restic-testing -o storage-class=GLACIER --verbose backup ~/test.txt
有人可以提出其他选择吗?
我开始将 C14 的 GLACIER 存储 class 与 restic 一起使用,直到现在它似乎工作得很好。
我建议以通常的方式使用 restic -r s3:s3.fr-par.scw.cloud/test-bucket init
创建存储库,这将在标准存储 class 中创建 config
文件和密钥。
对于备份,我使用命令:
$ restic backup -r s3:s3.fr-par.scw.cloud/test-bucket -o s3.storage-class=GLACIER --host host /path
与您所做的类似,除了选项是 s3.storage-class
而不是 storage-class
。
这样 data
和 snapshots
目录中的文件在 GLACIER 存储 class 中,您可以毫无问题地添加备份。
我还可以在数据位于 GLACIER class 中时挂载存储库(我想所有信息都来自缓存)所以我可以 restic mount /mnt/c14
并且我可以浏览文件,即使我无法复制它们或查看他们的内容。
如果我需要恢复文件,我用 s3cmd restore --recursive s3://test-bucket/
恢复标准 class 中的所有存储桶(参见 s3cmd),我测试所有文件在标准 [=35] 中是否正确=] 与:
$ 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
如果 GLACIER class 中至少有一个文件,则 returns 为真,因此您必须等待此命令 returns 为假。
显然恢复需要更多时间,但我使用 C14 glacier 作为第二或第三个备份,同时在 Backblaze B2 中使用另一个 restic 存储库,它是一个温暖的存储。
除了 vstefanoxx 's
我像 vstefanoxx 一样设置了 restic 存储库。
现在,如果您想 修剪 存储库...您不能,因为文件在 glacier
中并且 restic
需要读写权限到要修剪的桶。
Scaleway 的有趣之处在于 glacier
和 standard
class 之间的文件传输是免费的。因此,让我们将数据移回标准 class :
s3cmd restore --recursive s3://test-bucket
然后使用 vstefanoxx 给出的命令等到过程结束。一旦您的数据达到标准 class,您的成本就会增加五倍,因此我们必须高效:-)
所以我们现在修剪存储库:
restic prune -r s3:s3.fr-par.scw.cloud/test-bucket
完成后,将所有内容(实际上是 data, index
和 snapshots
但 不是 keys
)移回冰川:
s3cmd cp s3://test-bucket/data/ s3://test-bucket/data/ --recursive --storage-class=GLACIER
s3cmd cp s3://test-bucket/index/ s3://test-bucket/index/ --recursive --storage-class=GLACIER
s3cmd cp s3://test-bucket/snapshots/ s3://test-bucket/snapshots/ --recursive --storage-class=GLACIER
所以我们现在已经到了修剪存储库的地步,试图支付最少的钱!