title: Script to delete all files in directory then email
body: <p>Need a script to delete all files in a directory then email once complete, I have the below as a template but unsure if this will work - of course no email component has been added!</p>
  
  <pre><code>#!/bin/sh
  DIR="/var/www/public_html/docs/files/"
  LIST=`ls -l $DIR | grep -v "total 0"`
  FILES=`ls $DIR`
  cd $DIR
  if [ -z "$LIST" ]
  then
    exit
  else
    echo "Files Delete:"
    echo $FILES
    rm -f *
  fi
  </code></pre>
  
  <p>Update:</p>
  
  <pre><code>#!/bin/sh
  DIR="/home/test/test/docs/test/"
  cd $DIR
  rm -f *
  </code></pre>