<?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: Script Help in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3081974#M142873</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;As I can see you have already got a solution for your problem but if you are interested, here is an alternative which not uses perl and which not need to run continous (you can for example run it from cron).&lt;BR /&gt;&lt;BR /&gt;create a referencefile&lt;BR /&gt;&amp;gt; ref_file&lt;BR /&gt;update timestamp for ref_file from MDSF0011.MDS&lt;BR /&gt;&lt;BR /&gt;touch -am -r MDSF0011.MDS ref_file&lt;BR /&gt;&lt;BR /&gt;In your script&lt;BR /&gt;# chech if timestamp on MDSF0011.MDS has changed&lt;BR /&gt;if [ MDSF0011.MDS -nt ref_file ]&lt;BR /&gt;then&lt;BR /&gt;&amp;lt; do something &amp;gt;&lt;BR /&gt;# update timestamp for ref_file again&lt;BR /&gt;touch -am -r MDSF0011.MDS ref_file&lt;BR /&gt;fi&lt;BR /&gt;</description>
    <pubDate>Tue, 30 Sep 2003 14:48:52 GMT</pubDate>
    <dc:creator>Leif Halvarsson_2</dc:creator>
    <dc:date>2003-09-30T14:48:52Z</dc:date>
    <item>
      <title>Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3081967#M142866</link>
      <description>I need some help please. I am using 'expect' to ftp a file from one system to another but I need help with the unix front end script. I want to search one directory for a file that, always has the same name like "MDSF0011.MDS".  I need to check if the date or time stamp has changed. If it does than I will execute my ftp expect script. How can I check, by a script to see if this file has changed or not?</description>
      <pubDate>Tue, 30 Sep 2003 12:46:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3081967#M142866</guid>
      <dc:creator>Nobody's Hero</dc:creator>
      <dc:date>2003-09-30T12:46:24Z</dc:date>
    </item>
    <item>
      <title>Re: Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3081968#M142867</link>
      <description>You may want to look into "rsync" (see porting and archive center). It is used to keep remote files "synchronized" based on date.&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Tue, 30 Sep 2003 12:48:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3081968#M142867</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2003-09-30T12:48:04Z</dc:date>
    </item>
    <item>
      <title>Re: Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3081969#M142868</link>
      <description>I understand that. I need to run this script as an emergency. I dont have time to install any apps or modules, but thanks anyway. I know there are many utils to do this. I am going to run this on an old sco box in the field.</description>
      <pubDate>Tue, 30 Sep 2003 12:55:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3081969#M142868</guid>
      <dc:creator>Nobody's Hero</dc:creator>
      <dc:date>2003-09-30T12:55:46Z</dc:date>
    </item>
    <item>
      <title>Re: Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3081970#M142869</link>
      <description>and in turn, ftp that file to a windoze box...</description>
      <pubDate>Tue, 30 Sep 2003 13:10:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3081970#M142869</guid>
      <dc:creator>Nobody's Hero</dc:creator>
      <dc:date>2003-09-30T13:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3081971#M142870</link>
      <description>If you are into "perl", their is a module called Net::ftp that creates ftp connections and allows you to manipulate the transfers/queries through objects.&lt;BR /&gt;&lt;BR /&gt;Specifically method "mdtm" will return the last modify date for a remote file.&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Tue, 30 Sep 2003 13:12:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3081971#M142870</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2003-09-30T13:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3081972#M142871</link>
      <description>Here is a small script to do a ftp get-&lt;BR /&gt; &lt;BR /&gt;    use Net::FTP;&lt;BR /&gt;&lt;BR /&gt;    $ftp = Net::FTP-&amp;gt;new("some.host.name", Debug =&amp;gt; 0);&lt;BR /&gt;    $ftp-&amp;gt;login("anonymous",'-anonymous@');&lt;BR /&gt;    $ftp-&amp;gt;cwd("/pub");&lt;BR /&gt;    $ftp-&amp;gt;get("that.file");&lt;BR /&gt;    $ftp-&amp;gt;quit;&lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Tue, 30 Sep 2003 13:13:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3081972#M142871</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2003-09-30T13:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3081973#M142872</link>
      <description>The important thing to remember here is that you can't rely on a string comparison of the output of "ls" because after a time "ls" stops showing the time and replaces it with the month.&lt;BR /&gt; &lt;BR /&gt;With this in mind you have to use some form of the "stat()".&lt;BR /&gt; &lt;BR /&gt;This works, I thinkm in perl&lt;BR /&gt; #!/usr/bin/perl&lt;BR /&gt;&lt;BR /&gt;use File::stat;&lt;BR /&gt;&lt;BR /&gt;$MYFILE="MDSF0011.MDS";&lt;BR /&gt;$oldmodtime=stat($MYFILE)-&amp;gt;mtime;&lt;BR /&gt;   &lt;BR /&gt;while(1){                     &lt;BR /&gt;$modtime=stat($MYFILE)-&amp;gt;mtime;&lt;BR /&gt;if($modtime != $oldmodtime){&lt;BR /&gt;        'path to run my script goes here';&lt;BR /&gt;        $modtime=$oldmodtime;&lt;BR /&gt;}      &lt;BR /&gt;sleep 60;&lt;BR /&gt;}       &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 30 Sep 2003 13:16:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3081973#M142872</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2003-09-30T13:16:19Z</dc:date>
    </item>
    <item>
      <title>Re: Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3081974#M142873</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;As I can see you have already got a solution for your problem but if you are interested, here is an alternative which not uses perl and which not need to run continous (you can for example run it from cron).&lt;BR /&gt;&lt;BR /&gt;create a referencefile&lt;BR /&gt;&amp;gt; ref_file&lt;BR /&gt;update timestamp for ref_file from MDSF0011.MDS&lt;BR /&gt;&lt;BR /&gt;touch -am -r MDSF0011.MDS ref_file&lt;BR /&gt;&lt;BR /&gt;In your script&lt;BR /&gt;# chech if timestamp on MDSF0011.MDS has changed&lt;BR /&gt;if [ MDSF0011.MDS -nt ref_file ]&lt;BR /&gt;then&lt;BR /&gt;&amp;lt; do something &amp;gt;&lt;BR /&gt;# update timestamp for ref_file again&lt;BR /&gt;touch -am -r MDSF0011.MDS ref_file&lt;BR /&gt;fi&lt;BR /&gt;</description>
      <pubDate>Tue, 30 Sep 2003 14:48:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3081974#M142873</guid>
      <dc:creator>Leif Halvarsson_2</dc:creator>
      <dc:date>2003-09-30T14:48:52Z</dc:date>
    </item>
    <item>
      <title>Re: Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3081975#M142874</link>
      <description>Thanks Everyone.....</description>
      <pubDate>Wed, 01 Oct 2003 08:41:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3081975#M142874</guid>
      <dc:creator>Nobody's Hero</dc:creator>
      <dc:date>2003-10-01T08:41:43Z</dc:date>
    </item>
  </channel>
</rss>

