Originally Posted by elainelaw
can advise how to write a shell script to do that :
if the file ( the file name is /tmp/my_file ) is exist and this file is elder than 12 hours , then send me alert mail to inform me , if this file not exist , then do nothing .
Thx in advance.
Spell out your words, please.
Read the man page for the 'find' command, Pay particular attention to the "atime", "ctime", and "mtime" options. That will let you find the files based on your criteria.
And post what you've written so far and where you're getting stuck, and we can help. Otherwise, there are lots of bash scripting tutorials out there that can help you.