Monday, October 23, 2006

Amazing Backup statement

I was browsing Digg when I came across this gem. With this one command, you can back up an entire hard drive to a remote machine over ssh.

dd if=/dev/hda.img | ssh -c blowfish user@machine "dd of=hda"


Essentially, you read the hard drive and pipe it to a program on an ssh server that writes the image to a file. Wow. I guess to reverse this process, youd run the reverse command:

ssh -c blowfish user@machine "dd if=hda.img" | dd of=/dev/hda


Im always amazed at how much you can learn from a single command or line of code.

No comments: