我有大约 200 个子目录位于一个感兴趣的目录中:
$ ls backup
201302
201607
201608
201609
201610
201701
201702
201705
201801
201802
我想xyz.7z
为每个目录创建一个 7z 存档xyz
:
cd $HOME/backup/
7z a "storage/nas/TBL/compressed_backups/$xyz.7z" "$xyz" -mmt=4
所以最后我会把这些档案放在storage/nas/TBL/compressed_backups
:
201302.7z
201607.7z
201608.7z
201609.7z
201610.7z
201701.7z
201702.7z
201705.7z
201801.7z
201802.7z
此外,我想使用parallel
它来一次处理五个目录。(为此我有足够的计算能力)
parallel -j5 ::: 7z a "storage/nas/TBL/compressed_backups/$xyz.7z" "$xyz" -mmt=4
我怎样才能把这一切放在一起?