searches for executable files, i.e. for hacking attack detection
make sure all path are correct, i.e. /root/gumscripts/logs/ exists
make sure all path are correct, i.e. /root/gumscripts/logs/ exists
Code:
#!/bin/sh LOGTIME=`date "+%Y-%m-%d %H:%M:%S "` LOGFILE=/root/gumscripts/logs/${LOGTIME}new_files.log latest=$( find /home/*/public_html -maxdepth 5 -mtime -1 -type f \( -name "*.py" -or -name "*.php" -or -name "*.sh" -or -name "*.pl" \) -ls ) echo "$latest" > ${LOGFILE} [ -n "$latest" ] && #mutt -s "New Files Log" -a "/root/gumscripts/out.txt" username@email.com echo "$latest" | mutt -s "New files log $LOGTIME" username@email.com