#!/bin/bash DATA_DEVICE_UUID="C6CE6C2BCE6C1649" MOUNT_PATH="/mnt/extern" DATA="${MOUNT_PATH}/timelapse" CLIENT="timelapse@192.168.111.2" CLIENT_FOLDER="/timelapse" for i in `find ${DATA}/data/ -name "*.jpg"` do NUM_HARDLINKS=`stat --format="%h" ${i}` if [ ${NUM_HARDLINKS} -lt 2 ] then mv "${i}" "${DATA}/trash" fi done