Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Short: Is it possible to (robo)copy a directory tree using hard links instead of physical copy?

I want to make a daily backup of my data files, every day in it's own directory. Now most files don't change every day, so my idea to speed up backup and use less disk space was to copy the backup of (day-1) to (day) using hard links, then use robocopy to replace the files which have changed since yesterday. This way I would only need to copy the full backup once to the USB drive, afterwards I could just copy the changes and still have directories containing all the files, sharing files with other backups using hard links. This way I got two full backups but it uses only file space for one+differential, and the backup files are accessible without need for special software, which is a big plus for me.

Is this possible?
Is there a program to create hard link copies of all files in a directory tree?
Am I missing some pitfall I'm not aware of?

share|improve this question

4 Answers 4

up vote 5 down vote accepted

There is a way to make backups like you say, but I don't believe with Robocopy alone.

There are several programs that will hard link or dedupe backups, and be space efficient.

Here are a few programs I've used or ran across:

  • Dupemerge - free - While not a "backup program" it is a bulk hard linker.
  • hardlink backup - free for personal use - uses hard links
  • Duplicati - free - (dedupes I believe like rsync does)
  • rdiff-backup - free - dedupes like rsync

I believe what may be a good fit for your questions is Dupemerge. You could have a batch file execute Robocopy to copy the contents to a directory (ex. d:\backups\YYYY-MM-DD). When that command is done, the batch file could call Dupemerge on d:\backups. That would hard link the files within and across all the subdirectories of d:\backups.

The downside of this is you would need enough space on the external to hold the newly created unhard linked backup. After Dupemerge is run, the newly created backup will be hard linked and the space will be freed.

This would make restoring easy because each dated directory would appear to have a full backup.

As a side note, if you are going to use hard links, I like Link Shell Extension. It helps let you know what isn't hard linked, what is and what it is linked to.

I’ve run across other hard link or deduping programs, but I liked these the best.

share|improve this answer
1  
+1 For having a decent roundup and mentioning LSE. However, you forgot the single tool that gives the OP almost exactly what he wants: ln.exe's Delorean Copy ln.exe is written by the same person who write both Dupemerge and LSE. All that's missing is VSS support and... oh look! Here we go! ;-) –  afrazier Dec 15 '11 at 3:50
    
@afrazier good call with Delorean Copy. Looks like Delorean Copy has some good features, also that website is good for NTFS link information, I should read it more. I'm surprised about the 1023 link limit on Delorean Copy, however, probably not a problem for most. Dupemerge will link to another file at 1022 links. I guess the way the Delorian Copy works, linking to a non-source file wouldn't be desirable? I will have to read up more on it. Great suggestion. –  Scott McClenning Dec 15 '11 at 7:32
2  
The 1023 link limit is an NTFS limitation -- The directory entry's link counter attribute is only 10 bits. –  afrazier Dec 22 '11 at 17:28

BackupAssist will let you exactly what you require. Its use of hardlinks is named "Single Instance Store", but it's actually hard links under the hood. It can be used, among other things, to backup to USB drives the way you asked for, or to remote locations using rsync.

share|improve this answer

There is a flaw in your logic in the first place.

If you create hard links how can that be called a backup? once your file gets deleted/corrupted, your so-called backup goes that way too. All the requirements that you specified are usually covered by today's backup software.

P.S.: NTFS does't support hard links AFAK.

share|improve this answer
2  
Sorry, my description was not clear enough: I create a full copy using robocopy on a external USB drive. For the next day, I create a hard link copy, then replace all the files which have changed since yesterday. Now I have a two full copies on my USB drive, but at the space cost of one full + one differential. –  Sam Jun 14 '11 at 8:41
2  
Oh, and of course NTFS does support hard links. –  Sam Jun 14 '11 at 8:42
1  
The technique you describe is exactly what rsnapshot (seems to be down ATM) implements in Unixoid OS. It is definitely possible and works very well. Unfortunately for you rsnapshot doesn't run on Windows (that's why I write this as a comment only). But the FAQ mentions something about remote syncing Windows clients. If you have Unixoid machines around maybe this would work for you. I don't know any Windows equivalents of rsnapshot. –  halo Jun 14 '11 at 8:59
    
I don't see any gain by creating hard links to unchanged files. Backup softwares take backup based on Archive bit on/off. You should just copy those files which are modified since last backup. Also, I was under the impression that ONLY Unix File Systems support hard links. Thanks to bring it to my notice! –  anilmwr Jun 14 '11 at 9:11
    
@Halo Thought it should be used already at a lot of places. Pity I got no Unix-Computers around, so I'll have to wait for someone who knows about this for windows. Thanks for the heads-up! –  Sam Jun 14 '11 at 9:15

This can be done as found here: http://blog.mutable.net/post/2007/01/17/an-intelligent-backup-system-for-windows-part-4.aspx

share|improve this answer
1  
Welcome to Super User! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. –  Peachy Nov 7 '12 at 15:17

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.