SHARE
TWEET

Untitled

a guest Jan 24th, 2020 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
  20. fi
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top