dockerのvolumeの中身を別のvolumeに移すスクリプトのメモ
cpコマンドのオプションを使った。コピー元とコピー先の2つのボリュームをマウントしたコンテナをワンオフで起動する。
$ man cp
# 抜粋
-a Same as -pPR options. Preserves structure and attributes of files but not directory structure.
-v Cause cp to be verbose, showing files as they are copied.
-vはいつもの。-Rがあるのでディレクトの中身ではなく、ディレクトリごとコピーされるので、cpするときはcdでコピー先に移動してから行う。
ソース全体:
短いですが以上です。


