0
My music library is arranged like:
/data/music/Artist_-_Album[alac]/*.m4a
I need to be able to keep a copy of these in another format (apple lossless) and I'd want that like:
/data/music/Artist_-_Album[flac]/*.flac
This one liner is good at traversing directories and converting items to flac, but it leaves all of the files in the source directory... not optimal.
for f in /data/music/**/*.m4a; do avconv -i "$f" "${f%.m4a}.flac"; done
How can I change/edit/add to this script to make the output files to into a different folder that is named appropriately as shown above?
is there a specific reason you want to seperate the m4a from the flac files? ... also, could the folder with the m4a's in it contain folders too (i.e.
/data/music/**/m4a/*.m4a
and/data/music/**/flac/*.flac
)? – txtechhelp – 2014-01-01T22:50:26.270Why separate them? I don't want duplicates. I don't want to offsite backup the m4a's, etc. Just easier to keep them somewhere else. – AaronJAnderson – 2014-01-02T00:25:19.057
Valid concerns :) .. Do you care if there's 2 separate folders in the main folder (i.e.
/data/music/*/m4a/*.m4a
and/data/music/*/flac/*.flac
)? If not you can use the same script from above (with some adjustments), otherwise a little more script fu is needed for an answer – txtechhelp – 2014-01-02T00:54:00.040I really want them completely separate. The output location will probably be a different mount point completely. – AaronJAnderson – 2014-01-02T01:09:45.497