Question about --files-from= and folder structure

Bill Dorrian dorrian.2009 at
Fri Jan 3 13:39:07 MST 2014

I'm writing a script to sync some mp3 files. Due to a limitation in the 
number of destination files that can be read from my thumb drive, I'm 
not looking to preserve the original file structure (actually, I'm 
looking to sync *only the files* to the new destination directory).

The source files are all subfolders under /backup/Music:

./Adrian Legg/Mrs. Crowe's Blue Waltz/Paddy Goes To Nashville.mp3
./Adrian Legg/Mrs. Crowe's Blue Waltz/Sour Grapes.mp3
./Adrian Legg/Wine, Women & Waltz/Divorcee's Waltz.mp3
./Adrian Legg/Wine, Women & Waltz/Mrs. Crowe's Blue Waltz.mp3
./Adrian Legg/Wine, Women & Waltz/Nora Handley's Waltz.mp3
./Adrian Legg/Wine, Women & Waltz/Queenie's Waltz.mp3
./Adrian Legg/Wine, Women & Waltz/Silent Night.mp3
./Adrian Legg/Wine, Women & Waltz/St. Mary's (12 String).mp3
./Adrian Legg/Wine, Women & Waltz/St. Mary's (Nashville Tuning).mp3
./Adrian Legg/Wine, Women & Waltz/The Laird.mp3
./Adrian Legg/Wine, Women & Waltz/Tune For Derrol.mp3
./Adrian Legg/Wine, Women & Waltz/Waltzin' With Jesus.mp3
./Against Me!/Against Me! - I Was a Teenage Anarchist.mp3

The script that I'm running works - sort of - in that it syncs the 
files; but it syncs their parent directories too, which I'm trying to avoid.

This is the command that I'm running now ($f is defined as the name of 
the "files from" and the destination directory name).

rsync -rvt --delete --progress --files-from=/tmp/split/$f 
"/backup/Music" /media/bill/35BF-4240/$f/ >> /tmp/rsync.txt

In short, this is the resultant file structure from the command above:

/media/bill/35BF-4240/$f/Adrian Legg/Mrs. Crowe's Blue Waltz/Paddy Goes 
To Nashville.mp3

...but I really want it to look like this:

/media/bill/35BF-4240/$f/Paddy Goes To Nashville.mp3

Any thoughts on how to do that?

Thanks in advance,
Bill D.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the rsync mailing list