I am trying to rsync files from one server to another but getting this error

rsync: failed to set times on "/dept/intranet/dept/atest/.": Operation not permitted (1)

Can someone help me why so ?

I guess it is some permissions issue.

This is my command:

RSYNC=/usr/bin/rsync
SSH=/usr/bin/ssh
REMOTE_HOST=test.desktop

${RSYNC} -crlt -e ${SSH} ${LOCAL_DIR} ${REMOTE_HOST}:${REMOTE_DIR}

LOCAL_DIR = workplace1/f1/
permissions drwxr-xr-x   11 root     root         4096 Mar 19  2009 f1

REMOTE_DIR=/dept/intranet/dept/atest/f1/
permissions :drwxr-xr-x 14 dbld   a1     4096 Mar 19  2009 f1     
link|improve this question
could you give us more information? * your rsync command * local+remote user * file permissions – Brian C Oct 14 '10 at 11:53
edited the question. – TopCoder Oct 14 '10 at 12:07
feedback

migrated from stackoverflow.com Oct 16 '10 at 3:40

This question came from our site for professional and enthusiast programmers.

2 Answers

Just so we're on the same page:

-r recursive
-l preserve links
-c sync based on file checksum
-t preserve modification times

Then two things:

It's just a filesystem thingy

If the destination folder is a NFS mount, or some filesystem that doesn't handle well mod-times, well it breaks.

Try adding the -O (for --omit-dir-times) parameter to your command.

Modification times will be preserved, but omitted for directories:

${RSYNC} -crlOt -e ${SSH} ${LOCAL_DIR} ${REMOTE_HOST}:${REMOTE_DIR}

This is my best guess, since file sync seems to work, and your error happens on mod time sync. Anyway, do you really need to preserve modification times? The -c option skip files based on checksum (so mod times doesn't matter).

Or it is, actually, a permission problem

  • does the user running the script have enough privileges to edit/write the destination folder? (try ssh -vv test.desktop "touch /dept/intranet/dept/atest/f1/test")
  • does the user running the script is "the Right Oneā„¢" (try ssh -vv thegooduser@test.desktop "touch /dept/intranet/dept/atest/f1/test")

None of the above

Run your command with the -v option, for verbose.

link|improve this answer
feedback

Add -O (--omit-dir-times) to your command line to avoid it trying to set modification times on directories.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown