我一直在尝试调整以下单行,以便将其转移到dd
分区gzip
并将其复制到s3存储桶。然而,经过无数次的尝试,它仍然无能为力
sudo dd if=/dev/vg0/mdb-snap-00 | gzip | aws s3 cp - s3://backup-bucket/backup.gz
我错过了什么?
答案 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
谢谢