<?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 Script - capture log name in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-capture-log-name/m-p/4869655#M398463</link>
    <description>I have a crontab entry that creates a log file from sample entry:&lt;BR /&gt;00 07 * * 2 /root/make_net_recovery.ksh &amp;gt; /root/logs/`hostname`_net_recovery.log&lt;BR /&gt;.`date "+\%Y\%m\%d_\%H\%M"` 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;Is there a way within the script to capture the name assigned to the log file thats being generated ?&lt;BR /&gt;</description>
    <pubDate>Tue, 09 Nov 2004 09:04:10 GMT</pubDate>
    <dc:creator>MikeL_4</dc:creator>
    <dc:date>2004-11-09T09:04:10Z</dc:date>
    <item>
      <title>Script - capture log name</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-capture-log-name/m-p/4869655#M398463</link>
      <description>I have a crontab entry that creates a log file from sample entry:&lt;BR /&gt;00 07 * * 2 /root/make_net_recovery.ksh &amp;gt; /root/logs/`hostname`_net_recovery.log&lt;BR /&gt;.`date "+\%Y\%m\%d_\%H\%M"` 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;Is there a way within the script to capture the name assigned to the log file thats being generated ?&lt;BR /&gt;</description>
      <pubDate>Tue, 09 Nov 2004 09:04:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-capture-log-name/m-p/4869655#M398463</guid>
      <dc:creator>MikeL_4</dc:creator>
      <dc:date>2004-11-09T09:04:10Z</dc:date>
    </item>
    <item>
      <title>Re: Script - capture log name</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-capture-log-name/m-p/4869656#M398464</link>
      <description>When a script is run the variable $0 is the name of the script being run.&lt;BR /&gt;&lt;BR /&gt;In the script itself, echo $0 to the log file.&lt;BR /&gt;&lt;BR /&gt;You could also route the output with a | mailx -s "script is run" someone@your.net&lt;BR /&gt;&lt;BR /&gt;on the end of it. &lt;BR /&gt;&lt;BR /&gt;I'd suggest this statement in the script&lt;BR /&gt;&lt;BR /&gt;echo $0 &amp;gt;&amp;gt; /root/logs/`hostname`_net_recovery.log&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Tue, 09 Nov 2004 09:07:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-capture-log-name/m-p/4869656#M398464</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2004-11-09T09:07:48Z</dc:date>
    </item>
    <item>
      <title>Re: Script - capture log name</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-capture-log-name/m-p/4869657#M398465</link>
      <description>Do you mean the cron log?&lt;BR /&gt;&lt;BR /&gt;ls -tr /root/logs/*log* |tail -1&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff</description>
      <pubDate>Tue, 09 Nov 2004 09:14:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-capture-log-name/m-p/4869657#M398465</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2004-11-09T09:14:28Z</dc:date>
    </item>
    <item>
      <title>Re: Script - capture log name</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-capture-log-name/m-p/4869658#M398466</link>
      <description>Thanks</description>
      <pubDate>Tue, 09 Nov 2004 09:30:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-capture-log-name/m-p/4869658#M398466</guid>
      <dc:creator>MikeL_4</dc:creator>
      <dc:date>2004-11-09T09:30:08Z</dc:date>
    </item>
  </channel>
</rss>

