It just crossed my mind that I had to make a backup of some servers. Usually I only backup the home directory and databases, but just to be comfortable, I decided to create a backup of the entire harddisk. In this case, the server needs to keep running and serving websites and is located a couple of hundred kilometres away from here. Therefore it was no option to insert an extra harddisk and do a sector-to-sector copy.
The aim was to copy all files, compress them, and have the compressed file transfered to a mirror location. This can be achieved quite easily:
tar -cj / | ssh username@mirrorlocation.tld "cat > fullbackup_filename.tar.bz2"
After the full backup was created, and transfered to the mirror location, I saw that there was a compress rate of over 60%, which means the backup is still several gigabytes big. Time to buy some tapestreamer…
If you are on a local network or you don’t require encryption you can do it this way:
tar cj / | nc -p 9000 -l
Now you have started a server on the remote PC. Now you should connect to it from the mirror location:
nc original.location.tld:9000 | cat > fullbackup_filename.tbz
If you also don’t need compression, do this on the server side:
tar c / | nc -p 9000 -l
Now you have a way of transfering things a little faster, because you don’t need to encrypt every bit of data that goes out and you don’t need to decrypt what comes in.
Thanks for your reply.
Of course your solution works, but when I want to automate this, it\’s nicer to have it completely \’pushing\’ instead of having to open a port first. Another problem is that the way you apply this (for which of course iptables _could_ be used) is that about anyone could download that backup, which is definitely not what I want
Because the network is the bottleneck here, I don\’t mind the cpu usage (as long as the server keeps serving websites
). Anyways thanks for your advice. I think that for local area networks, or non-confidential data your way is the way to go.
Buy:Prozac.Zocor.SleepWell.Nymphomax.Acomplia.Lipothin.Lipitor.Benicar.Female Pink Viagra.Ventolin.Advair.Lasix.Zetia.Aricept.Female Cialis.Wellbutrin SR.Seroquel.Buspar.Amoxicillin.Cozaar….