delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/08/02/07:50:37

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:to:from:subject:date:message-id:references
:mime-version:content-type; q=dns; s=default; b=FaXFk8EIDljPT88D
pl3/FDEF7UQPF26aOxv8F28LS26tKr+1zfZUwJig5zAI7FcvIjB9PxPVYst3TKSC
4ICamk0WGY92v+9fywrWjGc1dBvaYtybpm9jYsT+9fd286ojwZKy/K2CyOZIymXy
hYLqIpAV4HSIWzMLTxo4LWzoZfA=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:to:from:subject:date:message-id:references
:mime-version:content-type; s=default; bh=liOKHTgAcfBE5O0BhD9uWs
cDJkA=; b=L17KB6d2uZnGFR224gm4ld2m8htqVDD45iysgtjCOeX7E3h4EFCD65
4YapteSTsYOZn93Gi/6bFowmIv+2TubNoahGf31t3ApsGDTzgAm+aD6eZzGE/s1X
ZU+/IABA2IsPtrzGihKYhUM+gSeVom0+hMx+w2SkWE/rTPO7ao46A=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-10.1 required=5.0 tests=BAYES_00,FREEMAIL_FROM,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,KAM_OTHER_BAD_TLD autolearn=ham version=3.3.2 spammy=oleksandr, Gavenko, gavenko, Oleksandr
X-HELO: blaine.gmane.org
To: cygwin AT cygwin DOT com
From: Oleksandr Gavenko <gavenkoa AT gmail DOT com>
Subject: Re: Recursively recreate hierarchy with NTFS hardlinks by Cygwin
Date: Wed, 02 Aug 2017 14:50:01 +0300
Lines: 42
Message-ID: <86a83i195i.fsf@gavenkoa.example.com>
References: <86efsu19xs DOT fsf AT gavenkoa DOT example DOT com>
Mime-Version: 1.0
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (windows-nt)
X-IsSubscribed: yes

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019