Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 04-19-2011, 09:02 PM   #1
LQ Newbie
Registered: Feb 2011
Posts: 7

Rep: Reputation: 0
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.
Old 04-20-2011, 12:46 AM   #2
Registered: May 2006
Location: Brisbane, Australia
Distribution: linux
Posts: 153

Rep: Reputation: 44
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] rsync with changing directory structure dormant Linux - Software 6 08-28-2010 03:32 PM
Convert directory structure from long file names in Linux to DOS 8.3 structure? manorina Linux - Software 5 09-12-2009 09:18 AM
how do I make a sensible list from a directory structure? oskar Linux - General 2 06-25-2008 12:27 PM
RSYNC Directory Structure? carlosinfl Linux - General 2 09-18-2007 01:58 PM
How to make RSYNC skip a directory due to error message ArchW Linux - Networking 5 07-13-2006 10:26 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:42 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration