Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm trying to sync 2 folders containing audio files of multiple types (WMA, MP3, M4V,...).

I want to sync these folders but the sync process should only take into account the file names, not the extensions. So, if folder A contains "the suburbs.mp3" and folder B contains "the suburbs.m4v", the sync program should consider these 2 files the same (and not sync them).

I was looking into the documentation of rsync but I can't seem find a way to do this.

Does anyone have a suggestion, or maybe suggestions for other software that can do this?

thanks, Thomas

share|improve this question
add comment

1 Answer

You could create empty files with all possible extensions and call rsync with --ignore-existing.

find A -type f \( -name '*.flac' -o -name '*.m4v' -o -name '*.mp3' -o '*.ogg' -o '*.wma' \) \
     -exec sh -c '
  for base; do
    base=${base%.*};
    for ext in flac m4v mp3 ogg wma; do : >>"$base.$ext"; done;
  done' _ {} +
# Do the same on B …
rsync -a --ignore-existing A B

You may be interested in mp3fs, a FUSE stackable filesystem that provides a view of a directory tree where all audio files appear as MP3. I don't think it would particularly help with your question, but it may be an alternate way to solve your problem or otherwise prove useful.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.