git-annex-remote-qcloud
git-annex external special remote protocol for qcloud (Tencent Cloud).
Since the potential users are all Chinese, so the guide is written in Chinese.
腾讯云对象存储服务 (COS) 免费 50G,且 API 和 SDK 文档齐全 (相对于某熊厂来讲),所以拿来做网盘做存储或者备份都是不错的选择。
假定读者对 git-annex 很熟悉。git-annex-remote-cloud
实现了 git-annex
的 external special remote protocol,于是可以利用 git
和 git-annex
将文件备份在 qcloud
云端。
安装
$ pip install --user git+https://github.com/foreverbell/git-annex-remote-qcloud
使用说明
$ mkdir playground && cd playground
$ export QCLOUD_CREDENTIALS='~/.qcloud'
$ git init
$ git annex init
$ git annex initremote qcloud type=external externaltype=qcloud encryption=none folder=music
$ git annex add "Blowing in the Wind.m4a"
$ git annex move . --to=qcloud # upload to qcloud and delete local copy
$ git annex get . --from=qcloud # download from qcloud
~/.qcloud
为配置文件,样例如下 (注意: qcloud 不提供建立 bucket 的 API,所以 bucket 需事先建好)。
app_id = 23333333
secret_id = you_secret_id
secret_key = B10wing_in_tHe_winD
bucket = annex
单元测试
确保 git-annex
升到足够新的版本有 testremote
功能。
$ .. (omitted) ..
$ git annex initremote qcloud type=external externaltype=qcloud encryption=none folder=test
$ git annex testremote qcloud
注意测试比较花时间,如果没耐心可以在最后一个命令后面加参数 --size=16Bytes
。