#!/bin/sh FILE=/tmp/pylogsentinel.daily if [ ! -f "$FILE" ]; then echo "Nothing to do" exit 0 fi echo "Sending email" cat "$FILE" | head -n 5000 | mail -s "pylogsentinel alert batch" root echo "Removing batch file" rm "$FILE"