3

I need to have a full server backup of a digital ocean droplet on my mac.

I´d like to use mac terminal to get the files from the server using scp or other method but I can´t make an image at the server and then download it to the local mac because I have not that much space on the server.

I´ve found this command here on SE

ssh user@remote "dd if=/dev/sda | gzip -1 -" | dd of=image.gz

It has the problem of creating the image at the server, no space for that.

Then I´ve tried this one using scp:

scp root@remote:/file/to/send /where/to/put

But modified it to

scp root@SERVER _IP:/ /path_to_local_folder

I got a reply from terminal that / is not a file... ok

What if I try:

scp root@SERVER _IP:/dev/vda1 /path_to_local_folder ?

My server is like this:

NAME FSTYPE SIZE MOUNTPOINT LABEL vda 60G
└─vda1 ext4 60G / DOROOT

I know I could just try but what is /dev? why not just /vda1 ?

And will this method be adequate for a 40gb transfer?

Thanks for any help.

Fred

Fred
  • 31

1 Answers1

1

I performed ssh user@remote "dd if=/dev/vda1 | gzip -1 -" | dd of=~/image.gz status=progress. Same as you tried but added the home squiggle and changed the source partition to that listed in df -h. I got the desired result of an image in my local home directory.

NOTE: I did this on Linux, but Mac should* be the same. Adding status=progress to the command adds a progress monitor to the BASH output.