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
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It only takes a minute to sign up.
Sign up to join this communityFrom 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.