I'm using 'find' at the end of a script to email me any .log files in the current directory that have been modified in the last 6 hours. I need this because the file names change so I can't be any more specific than requesting the recently changed ones.
for file in `find ./*.log -type f -mmin -360` ; do mail -s "MY LOG FILE - $file" firstname.lastname@example.org < $file ; done
...and it works sometimes, but more often it doesn't work even when I know there is a file in the directory that fits the criteria (having just been modified).
Any ideas why it's not working consistently for me?