5

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?

2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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