LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   make rsync ignore directory structure? (http://www.linuxquestions.org/questions/linux-general-1/make-rsync-ignore-directory-structure-876018/)

illumilore 04-19-2011 10:02 PM

make rsync ignore directory structure?
 
Is there a way to force rsync to not make directories in its destination directory; ie, to simply dump all of the files from the source directory directly into the destination without copying any of the folders that the files were originally in?

I tried --no-dirs, but that seems to only be for empty directories.

A.Thyssen 04-20-2011 01:46 AM

You will need to specify each file separatally. perhaps.

find directory -type f -print0 | xargs -I@ rsync @ destination/

You can speed this up by replacing xargs with something like parellel
or doing some extra handling of arguments. EG

find ... | xargs -- sh -c 'rsync "$@" destination' 'ss'

The 'ss' is needed otherwise the first argument will become $0 and not $1


All times are GMT -5. The time now is 08:59 PM.