I'm trying to copy all the files named 'specials.xml' in the current and all subdirs, and also create the name of each sub-directory. I'm using -R to rsync so it creates the relative paths for each corresponding subdirecotry. For example, I want cp:




but this isn't working:

$ mkdir ~/adminxml/
$ find /home/deploy/admin_xml_files -iname 'specials.xml' -exec rsync -aR ~/adminxml/ {} +

It's saying:

ERROR: destination must be a directory when copying more than 1 file. rsync error: errors selecting input/output files, dirs code 3) at main.c(543) [Receiver=3.0.7]...

It's probably something to do with the argument order of rsync, since it needs to be SRC DEST

$ mkdir ~/adminxml/
$ cd /home/deploy/admin_xml_files
$ rsync -avR $(find . -iname 'specials.xml') /path/to/adminxml/
|improve this answer|||||
  • Thanks, I was just about to try that after thinking more about the argument order. It works! Very nice. Thank you – user40696 Nov 11 '11 at 0:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.