#!/bin/bash # # Delete thumbnails for which the associated recording has been deleted. # Use at your own risk (and don't store important PNG's in your recordings # directory). # Set this to the location of your recordings directory RECORDINGS_DIR=/var/video cd $RECORDINGS_DIR for thumbnail in `ls *.png`; do recording=`basename $thumbnail '.png'` if [ ! -f $recording ]; then echo Deleting $thumbnail rm $thumbnail fi done