X-Recipient: archive-cygwin AT delorie DOT com X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1CBD83858C62 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=yandex.ru Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=yandex.ru X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1666450202; bh=+z8hIqjaoVpoNiWEIZm08fFBzJBBI26Qf39jadJUEoc=; h=In-Reply-To:Subject:Date:References:To:Message-ID:Reply-To:From; b=S+GbCpES09eIsNmYrjnKzufHV6FoSjMGHt7SNVeib5bkca+FZIiX7+f5lw4d7iDWr Qw34CHMINDkkFI6dl3V1CinmhyYMR2X0Y4n7TjZTIrqmkryhTaHEwre1HXdE8L+ElS rswt5qxsB6vSjSt2we6t6F1OpkmFFwFNKUDYjYOA= Authentication-Results: vla3-aeadfdeff55e.qloud-c.yandex.net; dkim=pass header.i=@yandex.ru Date: Sat, 22 Oct 2022 17:39:19 +0300 From: Andrey Repin X-Mailer: The Bat! (v9.3.4) Professional Message-ID: <3910040698.20221022173919@yandex.ru> To: Fergus Daly , cygwin AT cygwin DOT com Subject: Re: When only rsync will do .. or maybe not In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_THEBAT, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: cygwin AT cygwin DOT com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" Greetings, Fergus Daly! > Requirement: to move some selected files and folders under /folder1/ to /folder2/, preserving full pathnames. Full pathname would include the /folder1 making the requirement impossible from the start. If, on the other hand, you want to preserve directory structure, then a simple cd /f1; find . -xdev -type d -exec mkdir -p "/f2/{}" ';' -o -type f -exec mv '{}' "/f2/{}" ';' will do. > 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. `cp --reflink=always` will take care of duplicated content. Do note that paths must be relative. cp has an issue detecting "same volume" and failing or falling back to simple copy. > 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? No, not the purpose of rsync. > Question 3 > If not rsync, is there any operation for which "move" can be achieved > without involving "copy-then-delete"? Yep. See above. -- With best regards, Andrey Repin Saturday, October 22, 2022 11:56:05 Sorry for my terrible english... -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple