If I were you, I would start by creating a unique folder, the image of Destination/, and fill it with symlinks to your flac files, using -exec, *then* calling rsync only once with the -L option (--copy-links). Thus you should be able to benefit from the --delete option and keep an up-to-date destination tree... but take care of the corrupted symlinks (another -exec loop?). Greg
On Mon, Apr 23, 2012 at 8:50 AM, James Robertson <j...@mesrobertson.com> wrote: > I wish to sync a bunch of flac files that reside in various subfolders > to the root of a folder on a destination. > > An example of the directory structure on the source is: > > source> tree Music/ > Music/ > ├── R > │ ├── Radiohead > │ │ └── OK Computer > │ │ ├── 01 - Radiohead - Airbag.flac > │ │ ├── 02 - Radiohead - Paranoid Android.flac > │ └── Red Hot Chilli Peppers > │ └── Greatest Hits > │ ├── 01 - Red Hot Chili Peppers - Under the Bridge.flac > │ ├── 02 - Red Hot Chili Peppers - Give It Away.flac > > I am using this command which syncs fine but includes the directory > paths on the destination: > > rsync -rltDzvh --delete -e ssh Music/ user@192.168.1.1:/Destination/ > --include="*/" --include="*.flac" --exclude="*" > > So on the destination the structure is: > > destination> tree /Destination/ > /Destination/ > ├── R > │ ├── Radiohead > │ │ └── OK Computer > │ │ ├── 01 - Radiohead - Airbag.flac > │ │ ├── 02 - Radiohead - Paranoid Android.flac > │ └── Red Hot Chilli Peppers > │ └── Greatest Hits > │ ├── 01 - Red Hot Chili Peppers - Under the Bridge.flac > │ ├── 02 - Red Hot Chili Peppers - Give It Away.flac > > I want to prune all directories so only the files are placed into the > root of /Destination/ e.g. > > destination> tree /Destination/ > /Destination/ > ├── 01 - Radiohead - Airbag.flac > ├── 02 - Radiohead - Paranoid Android.flac > ├── 01 - Red Hot Chili Peppers - Under the Bridge.flac > ├── 02 - Red Hot Chili Peppers - Give It Away.flac > > All the files have different names so that's ok and I have reviewed > the various options in rsync such as --no-relative but have been > unable to get it working as desired. > > I also came up with: > > find ./Music/ -name "*.flac" -exec rsync -ltDzvh {} -e ssh > user@192.168.1.1:/Destination/ \; > > But this means using ssh keys and is probably inefficient and if I > want to use the --delete it would likely break everything. > > So how would I achieve this whilst still being able to use --delete or > --delete-excluded for times when I add, remove or rename items on my > Music library on the source and have those changes sync to the > destination? > -- > Please use reply-all for most replies to avoid omitting the mailing list. > To unsubscribe or change options: > https://lists.samba.org/mailman/listinfo/rsync > Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
-- Please use reply-all for most replies to avoid omitting the mailing list. To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html