#!/bin/sh DIR=$1 FILENAME=$2 if [ -z "$FILENAME" ]; then exit 1; fi echo "new file detected $DIR/$FILENAME" >> /tmp/newfile.log sleep 5 rm -f $DIR/$FILENAME >> /tmp/newfile.log 2>&1 exit 0