<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Some Scripting help in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/some-scripting-help/m-p/3060959#M138666</link>
    <description>A small script like the following should do:&lt;BR /&gt;&lt;BR /&gt;script: (Assuming that u save it as "script" )&lt;BR /&gt;&lt;BR /&gt;while read i&lt;BR /&gt;do&lt;BR /&gt;a=`echo $i | awk '{print $9}'`&lt;BR /&gt;b=`ll $a`&lt;BR /&gt;if [[ $b != $i ]]&lt;BR /&gt;then&lt;BR /&gt;        echo $a "has changed"&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;test file: (assuming that u ssave it as "test" )&lt;BR /&gt;-r-xr-xr-x   1 bin        bin           1415 Jul 24 06:10 .profile&lt;BR /&gt;-rw-------   1 root       root            22 Aug 27 06:08 .rhosts&lt;BR /&gt;-rw-------   1 root       sys           6014 Sep  2 00:03 .sh_history&lt;BR /&gt;-rw-rw-rw-   1 root       sys              0 Jul 25 01:25 devnull&lt;BR /&gt;-rw-rw-rw-   1 root       sys           1043 Jul 14 08:14 mbox&lt;BR /&gt;-rwxrwxrwx   1 root       sys            107 Sep  2 00:02 script&lt;BR /&gt;-rw-rw-rw-   1 root       sys              0 Sep  2 00:03 test&lt;BR /&gt;-rwxrwxrwx   1 root       sys          32768 Jul 21 08:28 trapd&lt;BR /&gt;-rw-r-----   1 root       sys           6796 Jul 21 08:27 trapd.c&lt;BR /&gt;&lt;BR /&gt;This the ll output of the files that you want to montior. Ensure that the file name is a fully qualified filename with the full path. Do a ll of the files that you want to monitor from the '/' dir and save them sequentially in the test file.&lt;BR /&gt;&lt;BR /&gt;Now execute this as&lt;BR /&gt;./script &amp;lt; test&lt;BR /&gt;(I assume that script &amp;amp; test are in the same dir, if not, invoke them with the proper full path of both)&lt;BR /&gt;&lt;BR /&gt;Put this script in cron and execute this to send a mail to you...&lt;BR /&gt;&lt;BR /&gt; echo $a "has changed" - You can change this to mailx command to have the script mail to you...</description>
    <pubDate>Tue, 02 Sep 2003 03:33:27 GMT</pubDate>
    <dc:creator>Bhuvaneswari Selvaraj</dc:creator>
    <dc:date>2003-09-02T03:33:27Z</dc:date>
    <item>
      <title>Some Scripting help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/some-scripting-help/m-p/3060955#M138662</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;Need a favour, I am in the midst of planning to write a script that will send a mail everytime the size or the permission or the timestamp or the owner or the group of a file changes.  Any idea how this can be done, as I have many files to monitor for changes.&lt;BR /&gt;&lt;BR /&gt;Thanks a lot&lt;BR /&gt;&lt;BR /&gt;regards</description>
      <pubDate>Tue, 02 Sep 2003 00:45:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/some-scripting-help/m-p/3060955#M138662</guid>
      <dc:creator>Joyce Suganthy</dc:creator>
      <dc:date>2003-09-02T00:45:13Z</dc:date>
    </item>
    <item>
      <title>Re: Some Scripting help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/some-scripting-help/m-p/3060956#M138663</link>
      <description>You would need something to compare it against in the firstplace.&lt;BR /&gt;&lt;BR /&gt;Maybe write a script that collects the required information for each file and stores it somewhere and can be the "master" file.&lt;BR /&gt;&lt;BR /&gt;Then your script can collect the information again, save it in a temporary file and you can use diff or comm to compare the original with the current and report any differences. &lt;BR /&gt;&lt;BR /&gt;Just an idea.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Tim</description>
      <pubDate>Tue, 02 Sep 2003 01:23:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/some-scripting-help/m-p/3060956#M138663</guid>
      <dc:creator>Tim Adamson_1</dc:creator>
      <dc:date>2003-09-02T01:23:34Z</dc:date>
    </item>
    <item>
      <title>Re: Some Scripting help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/some-scripting-help/m-p/3060957#M138664</link>
      <description>Create a baseline (run once, interactively):&lt;BR /&gt;&lt;BR /&gt;for a in file1 file2 file3 file4&lt;BR /&gt;do&lt;BR /&gt;ll $a &amp;gt;&amp;gt; /tmp/Last.ll&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Then your compare script, in a cron:&lt;BR /&gt;&lt;BR /&gt;for a in file1 file2 file3 file4&lt;BR /&gt;do&lt;BR /&gt;ll $a &amp;gt;&amp;gt; /tmp/Now.ll&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Diff.ll&lt;BR /&gt;Ch=`diff /tmp/Last.ll /tmp/Now.ll|wc -l`&lt;BR /&gt;if [ $Ch !ne "0"]&lt;BR /&gt;then&lt;BR /&gt;diff /tmp/Last.ll /tmp/Now.ll &amp;gt;&amp;gt; Diff.ll&lt;BR /&gt;mailx -f "/tmp/Diff.ll" you@here.com &lt;BR /&gt;cp /tmp/Now.ll /tmp/Last.ll&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;****&lt;BR /&gt;&lt;BR /&gt;Final debug/tweaks up to you - I cannot get to my UX server right now....&lt;BR /&gt;&lt;BR /&gt;Hope this helps!&lt;BR /&gt;Rob&lt;BR /&gt;</description>
      <pubDate>Tue, 02 Sep 2003 01:32:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/some-scripting-help/m-p/3060957#M138664</guid>
      <dc:creator>Rob_132</dc:creator>
      <dc:date>2003-09-02T01:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: Some Scripting help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/some-scripting-help/m-p/3060958#M138665</link>
      <description>...the best way to proof-read something is to FIRST send it to the world....  Try this instead as the compare script.&lt;BR /&gt;&lt;BR /&gt;Rob&lt;BR /&gt;&lt;BR /&gt;****&lt;BR /&gt;&lt;BR /&gt;Then your compare script, in a cron: &lt;BR /&gt;&lt;BR /&gt;&amp;gt; /tmp/Now.ll &lt;BR /&gt;for a in file1 file2 file3 file4 &lt;BR /&gt;do &lt;BR /&gt;ll $a &amp;gt;&amp;gt; /tmp/Now.ll &lt;BR /&gt;done &lt;BR /&gt;&lt;BR /&gt;&amp;gt; /tmp/Diff.ll &lt;BR /&gt;Ch=`diff /tmp/Last.ll /tmp/Now.ll|wc -l` &lt;BR /&gt;if [ $Ch !ne "0"] &lt;BR /&gt;then &lt;BR /&gt;diff /tmp/Last.ll /tmp/Now.ll &amp;gt;&amp;gt; /tmp/Diff.ll &lt;BR /&gt;mailx -f "/tmp/Diff.ll" you@here.com &lt;BR /&gt;cp /tmp/Now.ll /tmp/Last.ll &lt;BR /&gt;fi &lt;BR /&gt;</description>
      <pubDate>Tue, 02 Sep 2003 01:35:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/some-scripting-help/m-p/3060958#M138665</guid>
      <dc:creator>Rob_132</dc:creator>
      <dc:date>2003-09-02T01:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: Some Scripting help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/some-scripting-help/m-p/3060959#M138666</link>
      <description>A small script like the following should do:&lt;BR /&gt;&lt;BR /&gt;script: (Assuming that u save it as "script" )&lt;BR /&gt;&lt;BR /&gt;while read i&lt;BR /&gt;do&lt;BR /&gt;a=`echo $i | awk '{print $9}'`&lt;BR /&gt;b=`ll $a`&lt;BR /&gt;if [[ $b != $i ]]&lt;BR /&gt;then&lt;BR /&gt;        echo $a "has changed"&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;test file: (assuming that u ssave it as "test" )&lt;BR /&gt;-r-xr-xr-x   1 bin        bin           1415 Jul 24 06:10 .profile&lt;BR /&gt;-rw-------   1 root       root            22 Aug 27 06:08 .rhosts&lt;BR /&gt;-rw-------   1 root       sys           6014 Sep  2 00:03 .sh_history&lt;BR /&gt;-rw-rw-rw-   1 root       sys              0 Jul 25 01:25 devnull&lt;BR /&gt;-rw-rw-rw-   1 root       sys           1043 Jul 14 08:14 mbox&lt;BR /&gt;-rwxrwxrwx   1 root       sys            107 Sep  2 00:02 script&lt;BR /&gt;-rw-rw-rw-   1 root       sys              0 Sep  2 00:03 test&lt;BR /&gt;-rwxrwxrwx   1 root       sys          32768 Jul 21 08:28 trapd&lt;BR /&gt;-rw-r-----   1 root       sys           6796 Jul 21 08:27 trapd.c&lt;BR /&gt;&lt;BR /&gt;This the ll output of the files that you want to montior. Ensure that the file name is a fully qualified filename with the full path. Do a ll of the files that you want to monitor from the '/' dir and save them sequentially in the test file.&lt;BR /&gt;&lt;BR /&gt;Now execute this as&lt;BR /&gt;./script &amp;lt; test&lt;BR /&gt;(I assume that script &amp;amp; test are in the same dir, if not, invoke them with the proper full path of both)&lt;BR /&gt;&lt;BR /&gt;Put this script in cron and execute this to send a mail to you...&lt;BR /&gt;&lt;BR /&gt; echo $a "has changed" - You can change this to mailx command to have the script mail to you...</description>
      <pubDate>Tue, 02 Sep 2003 03:33:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/some-scripting-help/m-p/3060959#M138666</guid>
      <dc:creator>Bhuvaneswari Selvaraj</dc:creator>
      <dc:date>2003-09-02T03:33:27Z</dc:date>
    </item>
    <item>
      <title>Re: Some Scripting help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/some-scripting-help/m-p/3060960#M138667</link>
      <description>there's also a product named 'tripwire' that provides this functionality (if my memory serves me well).</description>
      <pubDate>Tue, 02 Sep 2003 06:15:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/some-scripting-help/m-p/3060960#M138667</guid>
      <dc:creator>hein coulier</dc:creator>
      <dc:date>2003-09-02T06:15:47Z</dc:date>
    </item>
    <item>
      <title>Re: Some Scripting help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/some-scripting-help/m-p/3060961#M138668</link>
      <description>&lt;BR /&gt;&lt;BR /&gt; use find . example :&lt;BR /&gt;&lt;BR /&gt; find $PATH -cmin -1 -print  1&amp;gt;/tmp/files.txt&lt;BR /&gt; &lt;BR /&gt; use cron avery minute for this example, and you can add mail command to send file content.&lt;BR /&gt;&lt;BR /&gt;Tom</description>
      <pubDate>Tue, 02 Sep 2003 06:25:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/some-scripting-help/m-p/3060961#M138668</guid>
      <dc:creator>TOMAS BERNABEU</dc:creator>
      <dc:date>2003-09-02T06:25:44Z</dc:date>
    </item>
    <item>
      <title>Re: Some Scripting help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/some-scripting-help/m-p/3060962#M138669</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;as already said, you need a file list for comparison, e.g. this three-lined example:&lt;BR /&gt;&lt;BR /&gt;-rw-r--r--   1 jxk        users            8 Sep  2 11:14 /tmp/jxk/flipflip&lt;BR /&gt;-rw-rw-rw-   1 root       sys             16 Sep  2 11:14 /home/jxk/flipflap&lt;BR /&gt;-rw-r--r--   1 jxk        users           33 Sep  2 11:15 /home/jxk/blipblop&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The attached script can make use of a list like the above. Admitted, the script is a bit crude, as it only echoes when you need to do some  sendmail activity.&lt;BR /&gt;The script will also react to differences in link numbers (unrequested), and the file list is updated every time: not particularly practical, but may serve as a starting point.&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;John K.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 02 Sep 2003 09:07:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/some-scripting-help/m-p/3060962#M138669</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2003-09-02T09:07:31Z</dc:date>
    </item>
    <item>
      <title>Re: Some Scripting help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/some-scripting-help/m-p/3060963#M138670</link>
      <description>&lt;BR /&gt;&lt;BR /&gt;You can use HP proprietary commands mkpdf to build a base line and pdfck to compare the base line against the current state of the system.  man mkpdf and pdfck for more info and examples.&lt;BR /&gt;&lt;BR /&gt;Hai</description>
      <pubDate>Tue, 02 Sep 2003 13:49:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/some-scripting-help/m-p/3060963#M138670</guid>
      <dc:creator>Hai Nguyen_1</dc:creator>
      <dc:date>2003-09-02T13:49:34Z</dc:date>
    </item>
    <item>
      <title>Re: Some Scripting help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/some-scripting-help/m-p/3060964#M138671</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;Thanks for the help&lt;BR /&gt;&lt;BR /&gt;John, &lt;BR /&gt;I have followed your way or finding the difference, but the script also gives the email alert if there is a difference in size change for a particular file, how do i check only change is the file permission, user and group... please help&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 05 Sep 2003 03:00:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/some-scripting-help/m-p/3060964#M138671</guid>
      <dc:creator>Joyce Suganthy</dc:creator>
      <dc:date>2003-09-05T03:00:39Z</dc:date>
    </item>
    <item>
      <title>Re: Some Scripting help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/some-scripting-help/m-p/3060965#M138672</link>
      <description>Hi Joyce,&lt;BR /&gt;&lt;BR /&gt;If you want a full-blown intrusion detection system, take a look at IDS/9000 which is available from HP for free:&lt;BR /&gt;&lt;A href="http://www.software.hp.com/cgi-bin/swdepot_parser.cgi/cgi/displayProductInfo.pl?productNumber=J5083AA" target="_blank"&gt;http://www.software.hp.com/cgi-bin/swdepot_parser.cgi/cgi/displayProductInfo.pl?productNumber=J5083AA&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;If your requirement does not justify such fuss, then modify the scripts the others have suggested to run the appropriate command. Most of your information is available using the "ll" command. Other then this, you might have to write a little perl routine or shell script to get exactly what you're looking for.&lt;BR /&gt;&lt;BR /&gt;Hope this helps,&lt;BR /&gt;&lt;BR /&gt;Ollie.</description>
      <pubDate>Fri, 05 Sep 2003 04:50:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/some-scripting-help/m-p/3060965#M138672</guid>
      <dc:creator>Ollie R</dc:creator>
      <dc:date>2003-09-05T04:50:42Z</dc:date>
    </item>
    <item>
      <title>Re: Some Scripting help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/some-scripting-help/m-p/3060966#M138673</link>
      <description>Hi again Joyce,&lt;BR /&gt;&lt;BR /&gt;the modified, attached script looks only at permissions, user, and group. It assumes that these three items of information are present in $FILENAME in the mentioned order, followed by full_path_filename. Example of three lines from $FILENAME:&lt;BR /&gt;&lt;BR /&gt;-rw-r--r-- jxk users /tmp/jxk/flipflip&lt;BR /&gt;-rw-rw-rw- root sys /home/jxk/flipflap&lt;BR /&gt;-rw-r--r-- jxk users /home/jxk/blipblop&lt;BR /&gt;&lt;BR /&gt;Empty lines are not permitted in $FILENAME.&lt;BR /&gt;However, I would not base my career on this script. Where are the perl one-liners?&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;John K.</description>
      <pubDate>Fri, 05 Sep 2003 07:26:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/some-scripting-help/m-p/3060966#M138673</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2003-09-05T07:26:28Z</dc:date>
    </item>
    <item>
      <title>Re: Some Scripting help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/some-scripting-help/m-p/3060967#M138674</link>
      <description>thanks alot for all of your help. I managed...</description>
      <pubDate>Tue, 09 Sep 2003 06:54:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/some-scripting-help/m-p/3060967#M138674</guid>
      <dc:creator>Joyce Suganthy</dc:creator>
      <dc:date>2003-09-09T06:54:36Z</dc:date>
    </item>
  </channel>
</rss>

