<div class="gmail_extra">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?).<br>

Greg<br><br><div class="gmail_quote">On Mon, Apr 23, 2012 at 8:50 AM, James Robertson <span dir="ltr"><<a href="mailto:j@mesrobertson.com" target="_blank">j@mesrobertson.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

I wish to sync a bunch of flac files that reside in various subfolders<br>
to the root of a folder on a destination.<br>
<br>
An example of the directory structure on the source is:<br>
<br>
source> tree Music/<br>
Music/<br>
├── R<br>
│   ├── Radiohead<br>
│   │   └── OK Computer<br>
│   │       ├── 01 - Radiohead - Airbag.flac<br>
│   │       ├── 02 - Radiohead - Paranoid Android.flac<br>
│   └── Red Hot Chilli Peppers<br>
│       └── Greatest Hits<br>
│           ├── 01 - Red Hot Chili Peppers - Under the Bridge.flac<br>
│           ├── 02 - Red Hot Chili Peppers - Give It Away.flac<br>
<br>
I am using this command which syncs fine but includes the directory<br>
paths on the destination:<br>
<br>
rsync -rltDzvh --delete -e ssh Music/ user@192.168.1.1:/Destination/<br>
--include="*/" --include="*.flac" --exclude="*"<br>
<br>
So on the destination the structure is:<br>
<br>
destination> tree /Destination/<br>
/Destination/<br>
├── R<br>
│   ├── Radiohead<br>
│   │   └── OK Computer<br>
│   │       ├── 01 - Radiohead - Airbag.flac<br>
│   │       ├── 02 - Radiohead - Paranoid Android.flac<br>
│   └── Red Hot Chilli Peppers<br>
│       └── Greatest Hits<br>
│           ├── 01 - Red Hot Chili Peppers - Under the Bridge.flac<br>
│           ├── 02 - Red Hot Chili Peppers - Give It Away.flac<br>
<br>
I want to prune all directories so only the files are placed into the<br>
root of /Destination/ e.g.<br>
<br>
destination> tree /Destination/<br>
/Destination/<br>
├── 01 - Radiohead - Airbag.flac<br>
├── 02 - Radiohead - Paranoid Android.flac<br>
├── 01 - Red Hot Chili Peppers - Under the Bridge.flac<br>
├── 02 - Red Hot Chili Peppers - Give It Away.flac<br>
<br>
All the files have different names so that's ok and I have reviewed<br>
the various options in rsync such as --no-relative but have been<br>
unable to get it working as desired.<br>
<br>
I also came up with:<br>
<br>
find ./Music/ -name "*.flac" -exec rsync -ltDzvh {} -e ssh<br>
user@192.168.1.1:/Destination/ \;<br>
<br>
But this means using ssh keys and is probably inefficient and if I<br>
want to use the --delete it would likely break everything.<br>
<br>
So how would I achieve this whilst still being able to use --delete or<br>
--delete-excluded for times when I add, remove or rename items on my<br>
Music library on the source and have those changes sync to the<br>
destination?<br>
<span class="HOEnZb"><font color="#888888">--<br>
Please use reply-all for most replies to avoid omitting the mailing list.<br>
To unsubscribe or change options: <a href="https://lists.samba.org/mailman/listinfo/rsync" target="_blank">https://lists.samba.org/mailman/listinfo/rsync</a><br>
Before posting, read: <a href="http://www.catb.org/%7Eesr/faqs/smart-questions.html" target="_blank">http://www.catb.org/~esr/faqs/smart-questions.html</a></font></span></blockquote></div><br></div>