SHOW:
|
|
- or go back to the newest paste.
1 | #!/bin/bash | |
2 | ||
3 | DATESTR=`date +%Y-%m-%d_%H-%M` | |
4 | ||
5 | cd /home/account/public_html | |
6 | find . -type f -size -20k -size +200c -ls > /path/to/these/logs/${DATESTR}.log | |
7 | ||
8 | echo "Subject: SITE File Changes" > /path/to/these/logs/${DATESTR}.diff | |
9 | echo "" >> /path/to/these/logs/${DATESTR}.diff | |
10 | diff /path/to/these/logs/${DATESTR}.log /path/to/these/logs/latest.log >> /path/to/these/logs/${DATESTR}.diff | |
11 | ||
12 | rm -f /path/to/these/logs/latest.log | |
13 | cp /path/to/these/logs/${DATESTR}.log /path/to/these/logs/latest.log | |
14 | ||
15 | if [[ $(wc -l < /path/to/these/logs/${DATESTR}.diff) -lt 3 ]] | |
16 | then | |
17 | rm -f /path/to/these/logs/${DATESTR}.* | |
18 | else | |
19 | - | sendmail email@addre.ss < /path/to/these/logs/${DATESTR}.diff |
19 | + | sendmail email@addre.ss < /path/to/these/logs/${DATESTR}.diff |
20 | fi |