Hello
I am using below script to monitor spam on server ::
Out put of this script is like ::
I want to have ::
script will set permission to 0000 for a folder from which more than 500 emails sent out..
Any help regarding this is highly appreciated.
I am using below script to monitor spam on server ::
Code:
#!/bin/bash
EMAIL="[email protected]
NOW=$(date +"%m-%d-%Y")
FILE="cwd.$NOW.txt"
grep "cwd=/home" /var/log/exim_mainlog | awk '{for(i=1;i<=10;i++){print $i}}' | sort | uniq -c | grep cwd | sort -n > /usr/local/cwd/$FILE
echo "Mail queue at `hostname` has $MQUEUE messages!!!" | mail -s "CRITICAL ALERT: Mail queue" -a /usr/local/cwd/$FILE $EMAIL
fi
Code:
4 cwd=/home/xxx/public_htmlme/xxxx/public_html/xxxx/xxxx/xxx/xxx
10 cwd=/home/xxxx/public_html/xxxx
14 cwd=/home/xxxx/public_html
30 cwd=/home/xxxx/public_html/xxxxt/wp-content/plugins/pie-register/classes
61 cwd=/home/xxxx/public_html
765 cwd=/home/xxxx/public_html/xxxx/media/kunena/avatars/resized/size200
script will set permission to 0000 for a folder from which more than 500 emails sent out..
Any help regarding this is highly appreciated.
Last edited: