rsync permissions and directory issues

Matt McCutchen hashproduct+rsync at gmail.com
Tue Aug 7 16:00:28 GMT 2007


On 8/7/07, Roni Gordon <rgordon at uhnresearch.ca> wrote:
> Hi all,
>
> I'm running the following rsync job via cron:
>
> rsync --recursive --compress --human-readable --progress --update
> --perms --chmod=a-w -e "ssh -i /rsync-key"
> user at host:/source_dir/ /target_dir
>
> rsync: failed to set permissions on "/target_dir/.": Operation not
> permitted (1)
> rsync: failed to modify permissions on "/target_dir/.": Operation not
> permitted (1)
> rsync: failed to set permissions on "/target_dir/.": Operation not
> permitted (1)
> rsync error: some files could not be transferred (code 23) at
> main.c(1385) [generator=2.6.9]
>
> The rest of the files are rsync-ed correctly.
>
> Do I need to leave off the trailing slash on the target dir? I don't
> actually want to touch this directory, just rsync its contents...

Then change your source argument to match all the contents of the
source directory rather than the source directory itself:

rsync --recursive --compress --human-readable --progress --update
--perms --chmod=a-w -e "ssh -i /rsync-key" user at host:/source_dir/'*'
/target_dir

The asterisk is quoted so that your shell passes it unchanged through
to the remote shell, which expands it.  Note that this approach
doesn't give you the option to delete extraneous files from
/target_dir .

Matt


More information about the rsync mailing list