From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from forward501o.mail.yandex.net (forward501o.mail.yandex.net [37.140.190.203]) by sourceware.org (Postfix) with ESMTPS id 1CBD83858C62 for ; Sat, 22 Oct 2022 14:50:04 +0000 (GMT) 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 Received: from vla3-aeadfdeff55e.qloud-c.yandex.net (vla3-aeadfdeff55e.qloud-c.yandex.net [IPv6:2a02:6b8:c15:341d:0:640:aead:fdef]) by forward501o.mail.yandex.net (Yandex) with ESMTP id 47D2B45C40B1; Sat, 22 Oct 2022 17:50:02 +0300 (MSK) Received: by vla3-aeadfdeff55e.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id Q8nNi4LxRg-o1i8O2w2; Sat, 22 Oct 2022 17:50:02 +0300 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 Received: from [192.168.1.10] (HELO daemon2.darkdragon.lan) by daemon2 (Office Mail Server 0.8.12 build 08053101) with SMTP; Sat, 22 Oct 2022 14:39:20 -0000 Date: Sat, 22 Oct 2022 17:39:19 +0300 From: Andrey Repin X-Mailer: The Bat! (v9.3.4) Professional Reply-To: cygwin@cygwin.com Message-ID: <3910040698.20221022173919@yandex.ru> To: Fergus Daly , cygwin@cygwin.com Subject: Re: When only rsync will do .. or maybe not In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 List-Id: 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...