<?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: symbolic link script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/symbolic-link-script/m-p/2776041#M76030</link>
    <description>@ Rodney,&lt;BR /&gt;&lt;BR /&gt;why not use Perl's File::Find module? (meanwhile it is part of the standard suite of modules).&lt;BR /&gt;Even if you're unsure how to write the callback function yourself, Perl can help you with its find2perl converter.&lt;BR /&gt;At the shell just try something like:&lt;BR /&gt;&lt;BR /&gt;e.g. &lt;BR /&gt;&lt;BR /&gt;find2perl /etc -type l &amp;gt; my_link_renewer.pl&lt;BR /&gt;&lt;BR /&gt;To place further tests of mtimes and your unlink(), and symlink() calls in there should be straight forward.&lt;BR /&gt;&lt;BR /&gt;Btw. always test opens for success, because with the pipe appended Perl is forking off a child, and connecting STDIN and STDOUT handles for the parent to read and the child to write.&lt;BR /&gt;Apart from this she was asking for the mtime not the atime.&lt;BR /&gt;When I have a look at the POD of stat() it should be in the 9th returned list element,&lt;BR /&gt;so something like&lt;BR /&gt;&lt;BR /&gt;next unless ($now &amp;gt; (lstat $_)[9] &amp;amp;&amp;amp; -l _);&lt;BR /&gt;&lt;BR /&gt;looks more appropriate to me.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Thu, 01 Aug 2002 07:50:52 GMT</pubDate>
    <dc:creator>Ralph Grothe</dc:creator>
    <dc:date>2002-08-01T07:50:52Z</dc:date>
    <item>
      <title>symbolic link script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/symbolic-link-script/m-p/2776036#M76025</link>
      <description>Does anyone have a script that finds all files with symbolic links containing modification dates exceeding the current date (dated in the future) and sets the date to the current date?&lt;BR /&gt;&lt;BR /&gt;This is on an hp-ux 11.11 system.&lt;BR /&gt;&lt;BR /&gt;Thank you,&lt;BR /&gt;Carol</description>
      <pubDate>Tue, 30 Jul 2002 21:52:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/symbolic-link-script/m-p/2776036#M76025</guid>
      <dc:creator>Carol Crose</dc:creator>
      <dc:date>2002-07-30T21:52:00Z</dc:date>
    </item>
    <item>
      <title>Re: symbolic link script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/symbolic-link-script/m-p/2776037#M76026</link>
      <description>Carol,&lt;BR /&gt;&lt;BR /&gt;Would a simple find command do it?&lt;BR /&gt;&lt;BR /&gt;find /path -type l -mtime +1 -exec touch {} \;&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills&lt;BR /&gt;</description>
      <pubDate>Tue, 30 Jul 2002 21:54:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/symbolic-link-script/m-p/2776037#M76026</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2002-07-30T21:54:54Z</dc:date>
    </item>
    <item>
      <title>Re: symbolic link script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/symbolic-link-script/m-p/2776038#M76027</link>
      <description>Rod,&lt;BR /&gt;The touch command doesn't work on sym links and the -mtime +1 would find files more than 1 day old, but not 1 day in the future.&lt;BR /&gt;&lt;BR /&gt;But thanks so much for your input.  I do appreciate it.&lt;BR /&gt;&lt;BR /&gt;Carol</description>
      <pubDate>Wed, 31 Jul 2002 20:27:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/symbolic-link-script/m-p/2776038#M76027</guid>
      <dc:creator>Carol Crose</dc:creator>
      <dc:date>2002-07-31T20:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: symbolic link script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/symbolic-link-script/m-p/2776039#M76028</link>
      <description>Carol,&lt;BR /&gt;&lt;BR /&gt;How about this perl script-&lt;BR /&gt;&lt;BR /&gt;open(INP,"find /path -type l -print|");&lt;BR /&gt;$now=time();&lt;BR /&gt;while(&lt;INP&gt;) {&lt;BR /&gt; @a=lstat($_);&lt;BR /&gt; next if $a[8] &amp;gt; $now;&lt;BR /&gt; $real=readlink($_);&lt;BR /&gt; unlink $_;&lt;BR /&gt; symlink($real,$_);&lt;BR /&gt; print "Updated $_ to $real\n";&lt;BR /&gt;}&lt;BR /&gt;close(INP);&lt;BR /&gt;&lt;BR /&gt;This will look at symbolic link files, look at the last access time of the link file itself and compare to the current date.&lt;BR /&gt;Since you can't touch a link, just remove it and recreate it.&lt;BR /&gt;&lt;BR /&gt;Hope this helps...&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills&lt;/INP&gt;</description>
      <pubDate>Wed, 31 Jul 2002 20:52:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/symbolic-link-script/m-p/2776039#M76028</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2002-07-31T20:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: symbolic link script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/symbolic-link-script/m-p/2776040#M76029</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;I don't have a script, but suggest that it could be done fairly easily using perl.&lt;BR /&gt;&lt;BR /&gt;Chris</description>
      <pubDate>Wed, 31 Jul 2002 20:56:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/symbolic-link-script/m-p/2776040#M76029</guid>
      <dc:creator>Chris Lonergan</dc:creator>
      <dc:date>2002-07-31T20:56:09Z</dc:date>
    </item>
    <item>
      <title>Re: symbolic link script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/symbolic-link-script/m-p/2776041#M76030</link>
      <description>@ Rodney,&lt;BR /&gt;&lt;BR /&gt;why not use Perl's File::Find module? (meanwhile it is part of the standard suite of modules).&lt;BR /&gt;Even if you're unsure how to write the callback function yourself, Perl can help you with its find2perl converter.&lt;BR /&gt;At the shell just try something like:&lt;BR /&gt;&lt;BR /&gt;e.g. &lt;BR /&gt;&lt;BR /&gt;find2perl /etc -type l &amp;gt; my_link_renewer.pl&lt;BR /&gt;&lt;BR /&gt;To place further tests of mtimes and your unlink(), and symlink() calls in there should be straight forward.&lt;BR /&gt;&lt;BR /&gt;Btw. always test opens for success, because with the pipe appended Perl is forking off a child, and connecting STDIN and STDOUT handles for the parent to read and the child to write.&lt;BR /&gt;Apart from this she was asking for the mtime not the atime.&lt;BR /&gt;When I have a look at the POD of stat() it should be in the 9th returned list element,&lt;BR /&gt;so something like&lt;BR /&gt;&lt;BR /&gt;next unless ($now &amp;gt; (lstat $_)[9] &amp;amp;&amp;amp; -l _);&lt;BR /&gt;&lt;BR /&gt;looks more appropriate to me.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 01 Aug 2002 07:50:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/symbolic-link-script/m-p/2776041#M76030</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2002-08-01T07:50:52Z</dc:date>
    </item>
    <item>
      <title>Re: symbolic link script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/symbolic-link-script/m-p/2776042#M76031</link>
      <description>Rodney, Ralph and Chris,&lt;BR /&gt;&lt;BR /&gt;I would like to thank you for your help.  The action I actually took to solve my symbolic link date problem was to use a script from Eric Herberholz from HP Tech Support below.  It worked!  Thanks so much for all your responses...I appreciate it!&lt;BR /&gt;&lt;BR /&gt;Carol&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;# unsupported script&lt;BR /&gt;find / -type l -exec ls -ld {} \; |   awk '{&lt;BR /&gt;    printf("rm %s;ln -s %s %s\n",$(NF-2),$(NF),$(NF-2));&lt;BR /&gt;  }' &amp;gt;/tmp/doit&lt;BR /&gt;-------------------------&lt;BR /&gt;&lt;BR /&gt;Notice the "unsupported script" comment above. This script assumes that there aren't any spaces in the name of the symbolic link nor in the name of the actual file. &lt;BR /&gt;&lt;BR /&gt;Look at the results in /tmp/doit and then decide if it has acurately captured the commands need to remove the symbolic links and recreate them. And then if it does, you could run /tmp/doit by making it executable or by running 'sh /tmp/doit'.&lt;BR /&gt;</description>
      <pubDate>Mon, 12 Aug 2002 18:28:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/symbolic-link-script/m-p/2776042#M76031</guid>
      <dc:creator>Carol Crose</dc:creator>
      <dc:date>2002-08-12T18:28:51Z</dc:date>
    </item>
  </channel>
</rss>

