Hi,
I'm fairly new to Linux shell scripting and brand new to this forum. I've searched and can't find how to do exactly what I need to do in a script. Here's the scenario. I created a shell script to find all changed files within the last 7 days, and email me the report. That works. However, I now need to exclude certain files or certain directories from my listing (in particular, those ending in .txt and .log). The machine is running SuSE Linux Enterprise Server (SLES9).
Here's my script (please don't laugh... I'm a beginner, ok?)
#-----------
find . -name "*.*" -mtime -7 -exec ls -ltrh >> /home/myuserid/changed.log {} \; |grep `date +%Y-%m`
/bin/mail -s "Changed Files Log"
myemail@mycompany.com < /home/myuserid/changed.log
mv /home/myuserid/changed.log /home/myuserid/changed.log.$DATE
#----------
what do I need to change on the syntax for find to exclude certain files or extensions in my resulting file (changed.log)?
Thank you very much for any help you could provide.