public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Oleksandr Gavenko <gavenkoa@gmail.com>
To: cygwin@cygwin.com
Subject: Re: Recursively recreate hierarchy with NTFS hardlinks by Cygwin
Date: Wed, 02 Aug 2017 11:50:00 -0000	[thread overview]
Message-ID: <86a83i195i.fsf@gavenkoa.example.com> (raw)
In-Reply-To: <86efsu19xs.fsf@gavenkoa.example.com>

On 2017-08-02, Oleksandr Gavenko wrote:

> 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.
>
> ``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 @@
>    1
>   -2
>

Experiments shown that my goal can be archived in single command:

  mkdir orig
  echo 1 >>orig/my.txt

  mkdir backup
  rsync -a orig/ backup/1
  rsync -a --link-dest=../1 orig/ backup/2

  echo 2 >>backup/2/my.txt
  cmp backup/1/my.txt backup/2/my.txt && echo ok
  cmp orig/my.txt backup/2/my.txt || echo ok

Thanks for Cygwin & rsync with NTFS link support!

-- 
http://defun.work/


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

  reply	other threads:[~2017-08-02 11:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-02 11:33 Oleksandr Gavenko
2017-08-02 11:50 ` Oleksandr Gavenko [this message]
2017-08-02 13:26   ` Oleksandr Gavenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86a83i195i.fsf@gavenkoa.example.com \
    --to=gavenkoa@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).