経緯
バックアップツールであるduplicityはS3やS3互換のバケットにバックアップを転送することができるとても便利なツールです。ところが、環境によっては、現在のduplicityはS3互換のバケット(IBM Cloud Object Storage等)をバックアップ先として利用できなくなっています。理由ですが、S3互換バケットを宛先指定するために必要なオプションである--s3-region-name
や--s3-endpoint-url
が、環境によっては使えないためです。例えば私の環境では、EPELで配布しているduplicityでこの事象にあたりました。
具体的に言うと、duplicityのオプションを表示すると、--s3-region-name
や--s3-endpoint-url
が表示されません。
$ duplicity --help | grep s3
boto3+s3://bucket_name[/prefix]
s3+http://bucket_name[/prefix]
s3://other.host[:port]/bucket_name[/prefix]
--s3-european-buckets
--s3-use-rrs
--s3-use-ia
--s3-use-glacier
--s3-use-deep-archive
--s3-use-onezone-ia
--s3-use-new-style
--s3-unencrypted-connection
--s3-multipart-chunk-size=number
--s3-multipart-max-procs=number
--s3-multipart-max-timeout=number
--s3-use-multiprocessing
--s3-use-server-side-encryption
--s3-use-server-side-kms-encryption
--s3-kms-key-id=S3_KMS_KEY_ID
--s3-kms-grant=S3_KMS_GRANT
実行時に指定してもエラーになります。
$ duplicity full --s3-region-name ap --s3-endpoint-url s3.jp-tok.cloud-object-storage.appdomain.cloud ./src/ boto3+s3://my-icos-bucket/
duplicity: error: no such option: --s3-region-name
原因
開発元とIssueでやりとりしましたが、結論としては、duplicityを実行する環境のライブラリの問題ということになりました。
確実な対応方法
いくつか試しましたが、もっとも確実な方法は次の方法でした。
tarballのダウンロードと展開
$ wget https://launchpad.net/duplicity/0.8-series/0.8.20/+download/duplicity-0.8.20.tar.gz
$ tar zxvf duplicity-0.8.20.tar.gz
$ cd duplicity-0.8.20
関連ライブラリのダウンロード
$ ./setup.py build_ext
ライブラリを指定してduplicityを実行
$ PYTHONPATH=. ./bin/duplicity --help | grep s3 | grep -E "region|endpoint"
--s3-region-name=S3_REGION_NAME
--s3-endpoint-url=S3_ENDPOINT_URL