Remote Backup Your Raspberry Pi with SSH via terminal - iot-root/garden-of-eden GitHub Wiki

Good find from community member: https://pixelfriedhof.com/en/remote-backup-your-raspberry-pi-with-ssh-via-terminal/

Backup

ssh username@<hostname> "sudo dd if=/dev/mmcblk0 bs=1M | gzip -" | dd of=~/sdbackup.gz

Note: this will take a long time...

Restore

diskutil unmountDisk /dev/disk1 gzip -dc ~/sdbackup.gz | sudo dd of=/dev/rdisk1 bs=1m conv=noerror,sync

⚠️ **GitHub.com Fallback** ⚠️