"&&" means if the run before the "&&" is successful (returns 0) then also run what is after the "&&" otherwise do not run what is after the "&&". In other words a mail messages is sent only when the /root/find.sh script sees a *.cgi process running.
/root/find.sh needs to contain:
If you want the process line mailed also than find.sh could do:
and the cron job would then be:
N.B.
1. "*/15" does not work in cron for all Unixes, you may need to (e.g. for Solaris) use "0,15,45" instead.
2. Every 15 minutes is not very frequent and if the CGI script only runs for 2 minutes you may miss it!
3. The "/bin/sh" is not necessary if the /root/bin.sh script is chmodded to be executable by user running the crontab, unless the /root/ filesystem is mounted with the -noexec option in which case the /bin/sh overcomes that!
Last edited by TonyFullerMalv; 04-01-2009 at 07:56 PM..
Hi,
I am currently using the find below to remove old files. I am redirecting the listing to a file and then use a while-loop and do a rm
cd ${directory}
find . \( ! -name . -prune \) \( -type f -name "*.trc" -mtime +10 \) | sed 's#^./##' | sed "s#^#${directory}/#" 2>/dev/null | tee -a... (4 Replies)
I need assistance with following requirement, I am new to Unix.
I want to do the following task but stuck with file creation date(sysdate)
Following is the requirement
I need to create a script that will read the abc/xyz/klm folder and look for *.err files for that day’s date and then send an... (4 Replies)
Hi all ,
I'm new to unix
I have a checked project , there exists a file called xxx.config .
now my task is to find all the files in the checked out project which references to this xxx.config file.
how do i use grep or find command . (2 Replies)
Hello,
Can anybody please tell me the command to find out the filesystem or a file which is consuming larger disk space sing i want to find out the file and want to compress it
please help me out
any help would be appreciated (6 Replies)
I need to find whether there is a file named vijay is there or not in folder named "opt" .I tried "ls *|grep vijay" but it showed permission problem.
so i need to use find command (6 Replies)