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] As anybody can see, this is the same old trivial error, where we are copying/synchronizing files to a root directory likely not having adequate permissions. Most answers on stuckchange suggest omitting dir times (eg. --omit-dir-times), and this may or may not work. However, this exclusion tends to affect all files and directories, and most times in my experience, maynot be a desireable solution. I've also tried an exclusion (and I thought this was crafty thinking on my part), for omitting the top dir, "eg. --exclude=/.", but still has no affect. There has to be something for omitting modifying only the top directory times? Right? This now seems such a common scenario, where users are mounting loop filesystems, NFS shares, etc; where a users do not have casual access to the "/." directory. Roger -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: not available URL: <http://lists.samba.org/pipermail/rsync/attachments/20230124/c62f6ac0/signature.sig>
> 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 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: not available URL: <http://lists.samba.org/pipermail/rsync/attachments/20230125/e6c11f06/signature.sig>