I have a series of preview images and RAW files in a directory structure (shown below), I quickly review the preview images, and delete those that I don't want.
The RAW files are in a RAW subdirectory of each directory.
What I'm looking for is a bash command, or small script that will delete the RAW file, if a file with the corresponding preview image doesn't exist.
The subdir tree looks like:
2016/ 05/ image1.jpg image2.jpg image3.jpg RAW/ image1.RAW image2.RAW image3.RAW
As you can imagine there are multiple year and month subdirectories, occasionally if there's been a large event, there may be a further set of subdirs below the month subdir, (as shown below) so ideally I'm looking for something I can chuck into cron to run once a day/week to just tidy up after any review/changes I make.
2016/ 05/ image1.jpg image2.jpg image3.jpg RAW/ image1.RAW image2.RAW image3.RAW event 1/ image4.jpg image5.jpg image6.jpg RAW/ image4.RAW image5.RAW image6.RAW event 2/ image7.jpg image8.jpg image9.jpg RAW/ image7.RAW image8.RAW image9.RAW