dd分区管道gzip和管道到aws桶

时间:2017-08-23 07:26:41

标签: bash amazon-s3 gzip dd

我一直在尝试调整以下单行,以便将其转移到dd分区gzip并将其复制到s3存储桶。然而,经过无数次的尝试,它仍然无能为力

sudo dd if=/dev/vg0/mdb-snap-00 | gzip | aws s3 cp - s3://backup-bucket/backup.gz

我错过了什么?

1 个答案:

答案 0 :(得分:0)

在gzip中使用-c标志

从手册页:

-c --stdout --to-stdout
Write output on standard output; keep original files unchanged.  If there are several input files, the output consists of a sequence of independently compressed members. To obtain better compression, concatenate all input files before compressing them.

然后

sudo dd if=/dev/vg0/mdb-snap-00 | gzip -c | aws s3 cp - s3://backup-bucket/backup.img.gz

谢谢