1

I'd make a backup of a entire remote filesystem ext3 to a local HD. This operation has to be made using ssh. The backup has to be get from the Client PC and not give to the Server. I hope was clear to explain my issue.

Some one could suggest me how to resolve it?

thank you so much!

2
  • Be aware that cloning a mounted filesystem is potentially problematic. It's better to start the box from a rescue disc or from a separate partition.
    – loevborg
    Feb 23, 2011 at 23:06
  • You have SSH access to the server, but you can't run any commands? (I'm guessing that's what you mean by 'get from the client, not give from the server'). Feb 23, 2011 at 23:08

3 Answers 3

2

I suggest using rsync, which can operate over ssh.

rsync -cavz user@remote_host:/remote/path /local/destination

(rsync must be installed on both sides)

rsync is designed to transfer directories from one machine to another using as little bandwidth as possible. By default, it only transfers the deltas between the source and destination.

The options above (-cavz) are the ones I normally use, and tell it to (-c) check checksums; (-a) preserve permissions, timestamps, symlinks, etc.; (-v) be verbose; and (-z) compress the transferred data.

3
  • it's a good choice for make the backup for the files, I'd like make the backup of the entire filesystem for example the /dev/hda1.I've tried it in this way root-> rsync -cavzp [email protected]:/dev/hda1 /home/user/Desktop/ the result is protocol version mismatch -- is your shell clean? (see the rsync man page for an explanation) rsync error: protocol incompatibility (code 2) at compat.c(173) [Receiver=3.0.7] Feb 24, 2011 at 22:17
  • I've received that error just when try to make the backup of the dev if make the backup of a file it's fine Feb 25, 2011 at 10:45
  • That's because /dev/hda1 is a block device and doesn't look like a file (at least to rsync). Assuming / is mounted on /dev/hda1 (doing df should tell you), you should be able to do "rsync -cavzpx [email protected]:/ /home/user/Desktop/backup/" (I think it will 'do the right thing' with /proc and /dev.) The -x tells it to stick with the disk it is on.
    – jwernerny
    Feb 25, 2011 at 15:32
1

The traditional method is to do something along the lines of:

  • On server create an archive of the files to transfer. tar or cpio are typical commands for this.
  • Transfer the archive across the network
  • On client extract the client archive into the final location.

You can either do this step by step, or use unix pipes and tell the archive commands to use pipes instead of actual file archives.

In the old days, I did the following on the machine with the files:

tar cf - . | rsh remotemachine tar xvBpf -

You could probably get things running with a command similar to

ssh servermachine "tar -C /location -cf - ." | tar xvf - 

Good luck

0

try this

http://en.wikipedia.org/wiki/Dd_%28Unix%29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .