Question about --files-from= and folder structure

Kevin Korb kmk at sanitarium.net
Fri Jan 3 13:51:34 MST 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I don't know of a simple solution that would work with both --delete
and with any number of files but here is an idea...

Make an additional folder and link all the mp3 files into it then
rsync that folder...

rm -rf /backup/Music.flat
mkdir /backup/Music.flat
find /backup/music -name "*.mp3" -exec ln {} /backup/Music.flat +
(now you have a dir with all your mp3 files un-treed)
rsync -rvti --delete --progress /backup/Music.flat/
/media/bill/35BF-4240/$f/



On 01/03/2014 03:39 PM, Bill Dorrian wrote:
> 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.
> 
> 
> 
> 
> 

- -- 
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~
	Kevin Korb			Phone:    (407) 252-6853
	Systems Administrator		Internet:
	FutureQuest, Inc.		Kevin at FutureQuest.net  (work)
	Orlando, Florida		kmk at sanitarium.net (personal)
	Web page:			http://www.sanitarium.net/
	PGP public key available on web site.
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlLHItYACgkQVKC1jlbQAQcTgwCfToaJGI+J+D6kLVd3ALGv5odC
9NQAn2iLYQmieSOOx0Ory+HZ7oy6bvE5
=7Zbu
-----END PGP SIGNATURE-----


More information about the rsync mailing list