Can someone please help me out on how to change this to make a tar file of a user home folder on the Raspberry and move it to my MAC desktop

ssh pi@xxxx "sudo dd if=/dev/mmcblk0 bs=1M | gzip -" | dd of=~/Desktop/pibackup.gz

1 Answer 1


From the MAC start a ssh session. I assume sudo on the RasPi is not asking for a password.

ssh pi@xxxx sudo tar -czf - -V "Backup of the home folder from myuser" -C /home/myuser/ ./ | dd of=~/Desktop/myuser_backup.tar.gz bs=1M

The options for tar mean: -c create a tar archive, z create a gziped archive. f is the archive name, here with - it is send to standard output so it can be piped to dd on the MAC, -V is a description stored in the archive, -C is the directory to start with the backup, ./ is the directory with subdirectories to backup.

This gziped tar archive is piped to dd on the MAC and its output file is specfied with of=. bs=1M is to increase the block size to 1 megabyte for transfer over the network to increase performance.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.