0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

duplicityで--s3-region-nameや--s3-endpoint-urlが使えない場合の対処法

Posted at

経緯

バックアップツールである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
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?