check a file within a certain time
Hi All,
This is more of a general linux question. I would like to test if a
file if exists, and if the test does not respond in 5 seconds it'
considered failed.
reason for this is that i have web servers that has mounted nfs
volumes, but when the NFS server is high on load accessing the nfs
mount on the web servers seems slow.
the mount is not disconnected, it's just that there is a delay accessing it
so what i'd like to do is test a file in the nfs mount e.g.
/var/www/nfsmount/checknfs.txt if it was detected within 5 seconds it
is ok if not i will send me an email alert about it.
i was trying the "read" command: read -t 5 <
/var/www/nfsmount/checknfs.txt or cat /var/www/nfsmount/checknfs.txt
| read -t 5 but it does not give me anything.
any idea how this can be done? TIA.
Regards,
Ron
Reply to: