<?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: File consistency in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/file-consistency/m-p/4453198#M359031</link>
    <description>Thx Mel Burslan ,&lt;BR /&gt;&lt;BR /&gt;for your latest program , does the -newer mean only compare the newer files so I need to setup a crontab job to run it in every 4 hour ? if yes , can advise if I want the program can be run at anytime to check the files in past 4 hours ( not only the newer file ) , what can i do ? thx</description>
    <pubDate>Wed, 08 Jul 2009 05:21:50 GMT</pubDate>
    <dc:creator>heaman1</dc:creator>
    <dc:date>2009-07-08T05:21:50Z</dc:date>
    <item>
      <title>File consistency</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-consistency/m-p/4453187#M359020</link>
      <description>I have two server in different site , each server have a directory , the files in the directories are as below .&lt;BR /&gt;&lt;BR /&gt;Direcotry in server A&lt;BR /&gt;=====================&lt;BR /&gt;#ll &lt;BR /&gt;-rw-r--r--         1 root        root         68186 Jun 19  15:30    aaa.txt&lt;BR /&gt;-rw-r--r--         1 root        root         68186 Jun 19  15:30    bbb.txt&lt;BR /&gt;-rw-r--r--         1 root        root         68186 Jun 19  15:30    ccc.txt&lt;BR /&gt;-rw-r--r--         1 root        root         68186 Jun 19  15:30    ddd.txt&lt;BR /&gt;"&lt;BR /&gt;&lt;BR /&gt;Directory in server B&lt;BR /&gt;=====================&lt;BR /&gt;#ll&lt;BR /&gt;-rw-r--r--         1 root        root         68186 Jun 19  15:30    Ora_aaa.txt&lt;BR /&gt;-rw-r--r--         1 root        root         68186 Jun 19  15:30    Ora_bbb.txt&lt;BR /&gt;-rw-r--r--         1 root        root         68186 Jun 19  15:30    Ora_ccc.txt&lt;BR /&gt;-rw-r--r--         1 root        root         68186 Jun 19  15:30    Ora_ddd.txt&lt;BR /&gt;"&lt;BR /&gt;&lt;BR /&gt;Some files will be appended to these directories time by time . &lt;BR /&gt;&lt;BR /&gt;The files size , date and no. of files in these directories should be the same ( except the file name , the files name in server B are begins with Ora_  ) &lt;BR /&gt;&lt;BR /&gt;Now , I would like to make sure the files in these two directories are the same and no file is missing  , so I would like to regularly check the files is the same or not so that I can take action to correct it immediately .&lt;BR /&gt;&lt;BR /&gt;can you advise the script to check the files in it are the same , eg. check the files regularly ( 4 hrs )  , if any files is missing then notify me so that I can take action to correct it . &lt;BR /&gt;</description>
      <pubDate>Mon, 06 Jul 2009 02:13:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-consistency/m-p/4453187#M359020</guid>
      <dc:creator>heaman1</dc:creator>
      <dc:date>2009-07-06T02:13:14Z</dc:date>
    </item>
    <item>
      <title>Re: File consistency</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-consistency/m-p/4453188#M359021</link>
      <description>First order of business for you is to setup trust between server A and server B, preferably not as root since everyone can read these files. root trust between servers will get you in trouble with auditors, so stay away from it.&lt;BR /&gt;&lt;BR /&gt;So, let's assume server B trusts server A via ssh keys (you can choose to trust via .rhosts but I advise strongly against it)&lt;BR /&gt;&lt;BR /&gt;OKflag=0&lt;BR /&gt;ran=$RANDOM&lt;BR /&gt;TMPDIR=/tmp/tempfile.${ran}&lt;BR /&gt;mkdir $TMPDIR&lt;BR /&gt;&lt;BR /&gt;cd /my/directory/path&lt;BR /&gt;for file in `ls -1`&lt;BR /&gt;do&lt;BR /&gt;scp server_B:/my/directory/path/Ora_${file} $TMPDIR&lt;BR /&gt;r=${?}&lt;BR /&gt;if [ $r -ne 0 ]&lt;BR /&gt;then&lt;BR /&gt;echo "Do something ${file} is missing on server B"&lt;BR /&gt;OKflag=1&lt;BR /&gt;fi&lt;BR /&gt;diff /my/directory/path/${file} $TMPDIR/Ora_${file} &amp;gt; /dev/null&lt;BR /&gt;rr=${?}&lt;BR /&gt;if [ $rr -ne 0 ]&lt;BR /&gt;then&lt;BR /&gt;echo "Do some other thing: $file is different on server B"&lt;BR /&gt;OKflag=2&lt;BR /&gt;fi&lt;BR /&gt;rm $TMPDIR/$Ora_{file}&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;if [ $OKflag -eq 0 ]&lt;BR /&gt;then &lt;BR /&gt;echo "Everything checked out fine at `date`"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Hope this helps&lt;BR /&gt;&lt;BR /&gt;Beware of syntax and typographical errors as the script was not tested in any unix platform.</description>
      <pubDate>Mon, 06 Jul 2009 03:29:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-consistency/m-p/4453188#M359021</guid>
      <dc:creator>Mel Burslan</dc:creator>
      <dc:date>2009-07-06T03:29:36Z</dc:date>
    </item>
    <item>
      <title>Re: File consistency</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-consistency/m-p/4453189#M359022</link>
      <description>thx Mel Burslan ,&lt;BR /&gt;&lt;BR /&gt;it works fine , for your method , sorry to have two more requirements .&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;1) as there are so many files in the directoies , it is not possible to copy all files to compare , can advise if only compare the file that created in a certain peroid of time ( eg. 4 hrs / 8 hrs ) what can i do ?&lt;BR /&gt;&lt;BR /&gt;p.s assume the file creation date are the name .&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;2) can advise if I also want to compare the file size ( to make sure the file consistency ) , is it possible ? &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;thx&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 06 Jul 2009 05:09:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-consistency/m-p/4453189#M359022</guid>
      <dc:creator>heaman1</dc:creator>
      <dc:date>2009-07-06T05:09:40Z</dc:date>
    </item>
    <item>
      <title>Re: File consistency</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-consistency/m-p/4453190#M359023</link>
      <description>Hi heaman,&lt;BR /&gt;&lt;BR /&gt;You can use scp/rcp to achive the above task&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Jitesh</description>
      <pubDate>Mon, 06 Jul 2009 05:20:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-consistency/m-p/4453190#M359023</guid>
      <dc:creator>Jitesh purohit_1</dc:creator>
      <dc:date>2009-07-06T05:20:22Z</dc:date>
    </item>
    <item>
      <title>Re: File consistency</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-consistency/m-p/4453191#M359024</link>
      <description>&amp;gt;1) as there are so many files in the directories, it is not possible to copy all files to compare, can advise if only compare the file that created in a certain period of time (eg. 4 hrs / 8 hrs) what can I do?&lt;BR /&gt;&lt;BR /&gt;You can create a reference file and only do files that are newer than that file.&lt;BR /&gt;If you do "ll -t", you can just stop when you see that file.  (Or you can remember the time and do complex date arithmetic to see if newer.)&lt;BR /&gt;&lt;BR /&gt;&amp;gt;2) I also want to compare the file size (to make sure the file consistency)?&lt;BR /&gt;&lt;BR /&gt;From the ll(1) output, you can compare the sizes too.</description>
      <pubDate>Mon, 06 Jul 2009 05:22:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-consistency/m-p/4453191#M359024</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-07-06T05:22:14Z</dc:date>
    </item>
    <item>
      <title>Re: File consistency</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-consistency/m-p/4453192#M359025</link>
      <description>You could also use rsync. it does incremental updates of the files, if their hash has changed.</description>
      <pubDate>Mon, 06 Jul 2009 05:30:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-consistency/m-p/4453192#M359025</guid>
      <dc:creator>likid0</dc:creator>
      <dc:date>2009-07-06T05:30:57Z</dc:date>
    </item>
    <item>
      <title>Re: File consistency</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-consistency/m-p/4453193#M359026</link>
      <description>" You can create a reference file and only do files that are newer than that file.&lt;BR /&gt;If you do "ll -t", you can just stop when you see that file. (Or you can remember the time and do complex date arithmetic to see if newer.)  "  ---&amp;gt;&amp;gt; &lt;BR /&gt;&lt;BR /&gt;sorry , I am not too unstandard what you mean to use "ll -t" to compare the time ? maybe I state more , what I would like is to compare the files that created within 4 hrs because there are too many files in server B , it is not possible to copy , can advise what can i do ? thx</description>
      <pubDate>Mon, 06 Jul 2009 08:12:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-consistency/m-p/4453193#M359026</guid>
      <dc:creator>heaman1</dc:creator>
      <dc:date>2009-07-06T08:12:20Z</dc:date>
    </item>
    <item>
      <title>Re: File consistency</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-consistency/m-p/4453194#M359027</link>
      <description>&amp;gt;I am not too understand what you mean to use "ll -t" to compare the time?&lt;BR /&gt;&lt;BR /&gt;Every 4 hours you touch a file.  Then you use the previous filename/time to stop looking.</description>
      <pubDate>Mon, 06 Jul 2009 10:29:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-consistency/m-p/4453194#M359027</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-07-06T10:29:49Z</dc:date>
    </item>
    <item>
      <title>Re: File consistency</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-consistency/m-p/4453195#M359028</link>
      <description>In order to accomplish what you want, I see not other way than both servers trusting each other bidirectionally, i.e., you will need to be able to copy files from one to the other and execute commands via ssh from one to the other. This is necessary because you will have to do a remote command execution to create marker files as Dennis said.&lt;BR /&gt;&lt;BR /&gt;you are on serverB:&lt;BR /&gt;&lt;BR /&gt;touch /var/tmp/4hours_marker&lt;BR /&gt;&lt;BR /&gt;...wait 4 hours or a little less&lt;BR /&gt;&lt;BR /&gt;you are on serverA:&lt;BR /&gt;&lt;BR /&gt;OKflag=0&lt;BR /&gt;ran=$RANDOM&lt;BR /&gt;TMPDIR=/tmp/tempfile.${ran}&lt;BR /&gt;mkdir $TMPDIR&lt;BR /&gt;&lt;BR /&gt;ssh serverB "find /my/directory/path -newer /var/tmp/4hours_marker &amp;gt; /tmp/filelist; touch /var/tmp/4hours_marker"&lt;BR /&gt;ssh serverB "scp `cat /tmp/filelist` serverA:/$TMPDIR"&lt;BR /&gt;&lt;BR /&gt;cd /my/directory/path&lt;BR /&gt;for file in `ls -1`&lt;BR /&gt;do&lt;BR /&gt;&lt;BR /&gt;if [ -a Ora_${file} ]&lt;BR /&gt;then&lt;BR /&gt;#file exists, compare it to the local file&lt;BR /&gt;diff /my/directory/path/${file} $TMPDIR/Ora_${file} &amp;gt; /dev/null&lt;BR /&gt;rr=${?}&lt;BR /&gt;if [ $rr -ne 0 ]&lt;BR /&gt;then&lt;BR /&gt;echo "Do something: $file is different on server B"&lt;BR /&gt;OKflag=2&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;else &lt;BR /&gt;echo "${file} is missing on serverB. Do something"&lt;BR /&gt;OKflag=1&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;diff /my/directory/path/${file} $TMPDIR/Ora_${file} &amp;gt; /dev/null&lt;BR /&gt;rr=${?}&lt;BR /&gt;if [ $rr -ne 0 ]&lt;BR /&gt;then&lt;BR /&gt;echo "Do something: $file is different on server B"&lt;BR /&gt;OKflag=2&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;if [ $OKflag -eq 0 ]&lt;BR /&gt;then&lt;BR /&gt;echo "Everything checked out fine at `date`"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;rm -r $TMPDIR&lt;BR /&gt;&lt;BR /&gt;I know there are holes in this procedure, most important of which is lack of extensive error checking but nature of this forums is to guide you down the path. I hope my script helps you wind the way, on which you can build your own script with all the error handling and else.</description>
      <pubDate>Mon, 06 Jul 2009 13:39:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-consistency/m-p/4453195#M359028</guid>
      <dc:creator>Mel Burslan</dc:creator>
      <dc:date>2009-07-06T13:39:20Z</dc:date>
    </item>
    <item>
      <title>Re: File consistency</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-consistency/m-p/4453196#M359029</link>
      <description>thx Mel, &lt;BR /&gt;&lt;BR /&gt;I tried your method&lt;BR /&gt;&lt;BR /&gt;ssh serverB "find /my/directory/path -newer /var/tmp/4hours_marker &amp;gt; /tmp/filelist; touch /var/tmp/4hours_marker" .&lt;BR /&gt;&lt;BR /&gt;I tried it but in do not create 4hours_marker file , it seems the command have error , if I just want to find the files created in 4 hours , how can i do it ? thx</description>
      <pubDate>Tue, 07 Jul 2009 05:28:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-consistency/m-p/4453196#M359029</guid>
      <dc:creator>heaman1</dc:creator>
      <dc:date>2009-07-07T05:28:47Z</dc:date>
    </item>
    <item>
      <title>Re: File consistency</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-consistency/m-p/4453197#M359030</link>
      <description>&amp;gt;do not create 4hours_marker file, it seems the command have error &lt;BR /&gt;&lt;BR /&gt;What had an error?  The touch didn't create the file?  Any error messages?</description>
      <pubDate>Tue, 07 Jul 2009 07:42:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-consistency/m-p/4453197#M359030</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-07-07T07:42:35Z</dc:date>
    </item>
    <item>
      <title>Re: File consistency</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-consistency/m-p/4453198#M359031</link>
      <description>Thx Mel Burslan ,&lt;BR /&gt;&lt;BR /&gt;for your latest program , does the -newer mean only compare the newer files so I need to setup a crontab job to run it in every 4 hour ? if yes , can advise if I want the program can be run at anytime to check the files in past 4 hours ( not only the newer file ) , what can i do ? thx</description>
      <pubDate>Wed, 08 Jul 2009 05:21:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-consistency/m-p/4453198#M359031</guid>
      <dc:creator>heaman1</dc:creator>
      <dc:date>2009-07-08T05:21:50Z</dc:date>
    </item>
    <item>
      <title>Re: File consistency</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-consistency/m-p/4453199#M359032</link>
      <description>&amp;gt;does the -newer mean only compare the newer files so I need to setup a crontab job to run it in every 4 hour?&lt;BR /&gt;&lt;BR /&gt;Yes.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;if I want the program can be run at anytime to check the files in past 4 hours (not only the newer file), what can I do?&lt;BR /&gt;&lt;BR /&gt;Then you need to do date arithmetic to invoke touch.  Or use perl.  Or possibly gnu find that allows minutes in the -mtime.</description>
      <pubDate>Wed, 08 Jul 2009 07:30:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-consistency/m-p/4453199#M359032</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-07-08T07:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: File consistency</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-consistency/m-p/4453200#M359033</link>
      <description>thx reply ,&lt;BR /&gt;&lt;BR /&gt;Then you need to do date arithmetic to invoke touch. Or use perl. Or possibly gnu find that allows minutes in the -mtime. --&amp;gt; &lt;BR /&gt;&lt;BR /&gt;can you please advise how to do it ? thx</description>
      <pubDate>Thu, 09 Jul 2009 06:12:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-consistency/m-p/4453200#M359033</guid>
      <dc:creator>heaman1</dc:creator>
      <dc:date>2009-07-09T06:12:53Z</dc:date>
    </item>
    <item>
      <title>Re: File consistency</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-consistency/m-p/4453201#M359034</link>
      <description>can advise how to use find to search the files on remote server  ? thx</description>
      <pubDate>Thu, 09 Jul 2009 06:26:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-consistency/m-p/4453201#M359034</guid>
      <dc:creator>heaman1</dc:creator>
      <dc:date>2009-07-09T06:26:36Z</dc:date>
    </item>
    <item>
      <title>Re: File consistency</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-consistency/m-p/4453202#M359035</link>
      <description>thx all,&lt;BR /&gt;&lt;BR /&gt;Rather than copy the files back for comparison  , is it possible to export the files to a list , then compare the lists in both servers , because copy the files back to local server , it seems increase the network traffic , can advise what can i do ? thx</description>
      <pubDate>Thu, 09 Jul 2009 06:33:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-consistency/m-p/4453202#M359035</guid>
      <dc:creator>heaman1</dc:creator>
      <dc:date>2009-07-09T06:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: File consistency</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-consistency/m-p/4453203#M359036</link>
      <description>&amp;gt;can you please advise how to do it?&lt;BR /&gt;&lt;BR /&gt;It's called hand waving, you are suppose to give up.  ;-)  Or manually enter the touch time for 4 hours ago.&lt;BR /&gt;(I personally would just write a C program to subtract 4 hours.)&lt;BR /&gt;&lt;BR /&gt;&amp;gt;date arithmetic to invoke touch. &lt;BR /&gt;&lt;BR /&gt;I don't know if Clay's date script will do minutes?&lt;BR /&gt;Some threads that mention it and other time manipulation with perl:&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=951459" target="_blank"&gt;http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=951459&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1048731" target="_blank"&gt;http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1048731&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1120611" target="_blank"&gt;http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1120611&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Gnu find:&lt;BR /&gt;&lt;A href="http://hpux.connect.org.uk/hppd/hpux/Gnu/findutils-4.4.2/" target="_blank"&gt;http://hpux.connect.org.uk/hppd/hpux/Gnu/findutils-4.4.2/&lt;/A&gt;</description>
      <pubDate>Thu, 09 Jul 2009 09:54:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-consistency/m-p/4453203#M359036</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-07-09T09:54:04Z</dc:date>
    </item>
  </channel>
</rss>

