public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Cyrille Lefevre <cyrille.lefevre-lists@laposte.net>
To: cygwin@cygwin.com
Subject: Re: When only rsync will do .. or maybe not
Date: Fri, 14 Oct 2022 15:36:20 +0200	[thread overview]
Message-ID: <b50fe687-f868-ae14-b683-7b2baf48c755@laposte.net> (raw)
In-Reply-To: <DB6P18901MB0055D8029AD580DE9D4AB12FA4229@DB6P18901MB0055.EURP189.PROD.OUTLOOK.COM>

Le 12/10/2022 à 12:55, Fergus Daly a écrit :
> Requirement: to move some selected files and folders under /folder1/ to /folder2/, preserving full pathnames.
> 
> Using cp with the switch --parents (taking care over syntax and importantly location $PWD) it is possible to _copy_ the
> Required content across from /folder1/ to /folder2/ but there does not seem to be a matching switch for mv that would
> achieve the same purpose.
> 
> One solution would be (i) to copy the required content to /folder2/ and then (ii) delete the identical content under /folder1/;
> but this is expensive (one might not even have the disk space to do it) and it seems seriously unsatisfactory and not without risk
> to have to copy folders and files (possibly huge) when all one wants to do is to change the {pathname} to them.
> 
> Question 1
> Would the command (or something like it, again with care over syntax and $PWD)
> $ rsync -axuv --progress {pathto}/folder1/{content} {pathto}/folder2/
> do the trick? Or is the very existence of the switch
> $ rsync -axuv --remove-source-files --progress {pathto}/folder1/{content} {pathto}/folder2/
> indicative that here too the "move" is achieved through a two-stage "copy-then-delete" operation?
> 
> Question 2
> If rsync can provide a genuine "move" capability then is installing the rsync package adequate to the purpose;
> or would librsync-devel and/or librsync2 packages need to be installed also?
> 
> Question 3
> If not rsync, is there any operation for which "move" can be achieved without involving "copy-then-delete"?
> 
> Thank you for any assistance.
> 
> 

Hi,

how about find /source | cpio -pdml /target
alternative, cp -alu --parent /source /target
then purge /source

Regards,

/me
-- 
mailto:Cyrille.Lefevre-lists@laposte.net


  reply	other threads:[~2022-10-14 13:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-12 10:55 Fergus Daly
2022-10-14 13:36 ` Cyrille Lefevre [this message]
2022-10-14 15:35   ` Lemke, Michael  SF/HZA-ZE2E
2022-10-22 14:39 ` Andrey Repin

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=b50fe687-f868-ae14-b683-7b2baf48c755@laposte.net \
    --to=cyrille.lefevre-lists@laposte.net \
    --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).