I usually create remote backup image of my raspberrypi from my macbook by using:
ssh pi@xx.x.x.xx "sudo dd if=/dev/mmcblk0 bs=1M” | pv | gzip - | dd of=/Users/USER/Downloads/pibackup.gz
There are drawbacks but It works quite fine and i'm ok with it. Recently i found pishrink and i would like to include it in the aforementioned pipe maybe removing gzip since pishrink can do it itself. So first think i installed pyshrink on my raspberry and then i tried to run something like
ssh pi@xx.x.x.xx "sudo dd if=/dev/mmcblk0 bs=1M status=progress | pishrink.sh -az -"| dd of=/Users/USER/Downloads/pibackup.img.gz
But it doesn't work. Does anyone got some suggestion?
dd
at all. You could just dossh pi@xx.x.x.xx "sudo cat /dev/mmcblk0 | pv | gzip - > /Users/USER/Downloads/pibackup.gz
. See dd vs cat -- is dd still relevant these days? – terdon Oct 04 '20 at 13:45"
. I just wanted to point out that you don't needdd
and you probably should avoid it since its syntax makes it very easy to make a horrible mistake. Also, you should probably do the compression on the pi instead of locally. No reason to transfer the uncompressed data over the network. – terdon Oct 04 '20 at 14:08