Tip of the day: Linux script to see which reports are run during the day
Mike Schwartz
mschw at athenet.net
Fri Feb 3 05:45:08 PST 2012
Since the fP list has been a little slow, I thought I would pass along
this script I whipped up last night.
A friend who does most of his own filePro programming is changing his
printer setup. He asked me if there was some way in filePro to capture the
name of each report that is run during a typical day. I whipped up this
quick Linux script and he was happy with it, but I thought I would throw
this out to the group to see if any of you would have done things
differently:
----- ----- -----------------------------------
>/tmp/zrptlist.txt
for i in {1..10000} # loop 10000 (5-second) intervals
13.8 hours
do
ps -ef | grep -y report | grep -v 'grep\|pv\|\/u\/reports' | grep -y
"\-f" >>/tmp/zrptlist.txt
echo $i # Display loop count
tail /tmp/zrptlist.txt # Display last few reports that were run
sleep 5
done
----- ----- ----------------------------------
The script only runs every 5 seconds, so there's a slight possibility
it will miss some quick-running reports.
It has a loop rather than a cron job so that the user has more control
over when it runs. He will probably only run it occasionally.
It skips reports that go to the video screen. It skips the "grep"
line that is calling it. It skips any of the overnight batch reports that
print to files in the /u/reports subdirectory.
Enjoy!
Mike Schwartz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.celestial.com/pipermail/filepro-list/attachments/20120203/3e7668bd/attachment.html
More information about the Filepro-list
mailing list