Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm doing a backup of multiple external servers on a local machine using rsnapshot and it's working beautifully. Now, I'd like to clone the destination snapshots on an external disk that will be rotated. The thing is, I'd like to maintain the hard links structure to save space on the external disk.

I can clone the snapshots on the local machine to the external disk, but what weights 10GB on the local machine becomes 70GB on the external disk because the hard links structure is not reproduced. I don't want the external disk snapshots to link towards the local machine, but I'd like the same hard link logic without having to transfer the data twice from my multiple external servers:

daily.0/
daily.1/ -> only differences from daily.0/
daily.2/ -> only differences from daily.1/
...

Is it possible using rsync (or another tool) to replicate the structure of my local snaphosts elsewhere? Or just to simply tell rsnapshot to put the snapshots in two different destinations using the same rotation mechanism?

Thank you for your ideas!

share|improve this question

1 Answer 1

up vote 2 down vote accepted

If you use rsync with -H to copy the entire directory (i.e. the parent of your daily.n directories) it will preserve the hard links when copying to a new location.

I don't know of a nice way to only copy individual snapshots to an external disk and preserve the hard links - hard links only work on the same filesystem.

share|improve this answer
    
Excellent, I'll try it out but seems like the option I wanted after looking it up in the man. I initially thought the hard links would be maintained but with the same source, i.e. the local filesystem and not the new copy on the external hard disk. –  lpfavreau Mar 2 '10 at 0:10
    
Works like a charm, thanks! –  lpfavreau Mar 2 '10 at 2:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.