LoginSignup
3

More than 5 years have passed since last update.

embulk-encoder-encrypted_zip: 出力ファイルを暗号化ZipにするEncoder Plugin

Last updated at Posted at 2016-03-04

はじめに

Embulk は「データ→変換→データ」なバッチ処理を簡単に実現するbulk data loaderです。

出力ファイルを暗号化Zipしたかったのですが、それらしい方法・Pluginが見つからなかったので作りました(再発明してたらやだなぁ・・・)。

Version

  • Embulk: 0.7.4, 0.8.6

で動作確認しています。

Code

使い方

install

embulk gem install embulk-encoder-encrypted_zip

設定例

encoder plugin なので、 out の配下に設定を書きます。

config.yml
out:
  encoders:
    - type: encrypted_zip
      filename: 'result.%03d.%03d.csv'
      password: 'mypassword'
  type: file
  path_prefix: ./path/to/output/data
  file_ext: zip
  formatter:
    type: csv
  • filename: Zipの書庫内のファイル名のパターンです。
  • password: Zipの暗号化に使うパスワードです。

config.ymlconfig.yml.liquid とすると、環境変数などを埋め込めるのでその辺の組み合わせで使うと便利です。

参考) http://www.embulk.org/docs/built-in.html#using-variables

さいごに

EmbulkのPluginは本当に簡単に作れるので凄いなぁ。

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
3