Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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     
share|improve this question

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

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

    
could you give us more information? * your rsync command * local+remote user * file permissions –  Brian Clozel Oct 14 '10 at 11:53
    
edited the question. –  TopCoder Oct 14 '10 at 12:07

3 Answers 3

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.

share|improve this answer
    
Thank you for the --omit-dir-times tip. Really helps. –  JakeGould Dec 24 '13 at 2:09

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

Also read this: http://stackoverflow.com/questions/667992/rsync-error-failed-to-set-times-on-foo-txt-operation-not-permitted

share|improve this answer

In my case I've solved the problem by granting permissions on the parent directory where the sync was taken place.

Actually the owner of the parent directory was other than the user doing the sync.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.