Re: Exclude modifying top dir?

Roger via rsync <[email protected]>
Newsgroups gmane.network.rsync.general
Message-ID <[email protected]>
> On Tue, Jan 24, 2023 at 11:51:42PM -0500, Roger wrote:
>I keep getting the following error.  After several years I've had it, and am 
>posting to the mailing list in hopes of better advice than stuckchange.
>
>rsync: [generator] failed to set times on "/mnt/tmp/.": Operation not permitted (1)
>rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1336) [sender=3.2.7]

I've figured-out this trivial problem.

This "cannot modify times error" on the top directory is obviously due to lack 
of permissions.  However, I realized, rsync is often used for synchronizing 
such mounted file system points without write access to the top dir; with write 
access only within subsequently lower dirs.

For example, the previously used or incorrect syntax:

$ rsync -ax /some/files/ /mnt/tmp
rsync: [generator] failed to set times on "/mnt/tmp/.": Operation not permitted (1)

To resolve; looking at "files/" within "/some/files/", either terminate the 
source folder with a file name, directory or glob '*' character.

Examples:

$ rsync -ax /some/files /mnt/tmp
$ rsync -ax /some/files/dir /mnt/tmp
$ rsync -ax /some/files/* /mnt/tmp

If I'm not mistaken, the trailing slash on the source directory attempts to 
modifying the destination "/." file, a link pointing to the top directory!

WOW!  This problem with syntax has been nagging me forever!

Now for figuring-out how to filter this scenario for user input via sh/bash 
scripting.

Roger

-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
signature.asc (application/pgp-signature, 488 B)
-----BEGIN PGP SIGNATURE-----

iQEzBAABCAAdFiEE9RWsHyMf/E7wvN52Bs6g7OKIfHUFAmPR9M8ACgkQBs6g7OKI
fHVYDAf+NJDWNRlZ0S9sxicUxVvjBL9JF+cKcEFHEPLsBKra9002NrGFKYkTFTOJ
9t8bsXmVYoPdzvftjLEpEwteSN4F3iAaP903mk2urh/oWLUnsAZ78KL0jHztoJgL
sqKAxh5ICFW5mqBodAlLtp2hKcU0l7BFc01RmHrKpD2C6byfTgeHmNIM71XvuAJz
EZrdeulc/lxPBHSWg6YIA749ZdkeNzw67t8lPifYE3aV8gCYpjObKhYPPiU73UTb
YFi5Yvr4p/oIgBsHz5MVzm02ati7Iivp664mett2YAmGzF9ASTH5vTPI/khBFMKQ
cq7oVM8BzCajT/myEW6wRYTQakysgA==
=Z8jZ
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.