This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Recursively recreate hierarchy with NTFS hardlinks by Cygwin

I am going to write backup solution for my personal laptop.

I have 240GB SSD for development work and 500GB HDD for media files and

I am care only about project files and don't care about windows files or
program installation (as registry also should be preserved for backup to be

On Linux I uses:

  cp -al /backup/proj/DATEOLD  /backup/proj/DATENEW
  rsync ... /home/user/proj/ /backup/proj/DATENEW/

and employ hardlinks to preserve space.

NTFS FS has hardlinks. With ``cygutils-extra`` I can:

  $ winln $FROM $TO
  $ echo >>$FROM
  $ cmp $FROM $TO && echo OK

But I don't understand how to emulate recursive behavior of ``cp -r -l``.

Cygwin ``cp -l`` can use hard links but only with:


``rsync --hard-links`` isn't reliable:

  bash# echo 1 >orig.txt

  bash# rsync -a --hard-links orig.txt new.txt

  bash# echo 2 >>orig.txt

  bash# diff -u orig.txt new.txt
  --- orig.txt    2017-08-02 14:04:36.976875300 +0300
  +++ new.txt     2017-08-02 14:04:16.547209000 +0300
  @@ -1,2 +1 @@

There is Windows build-in ``robocopy`` utility but its documentation looks too
complex, I don't like to mix Cygwin and Windows paths and looks like it
doesn't support hard link from "Robocopy.exe /? | grep -i hard".

As development of rdiff-backup stalled in 2009 I don't believe that it
supports hard links in native Windows build.

As a bonus I am also interested to hear about solution with include data
integrity checks to detect data altering or rotting of storage bits in backup.
I think about employing md5sum utility...


Problem reports:
Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]