<?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: New to UNIX, need help with script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/new-to-unix-need-help-with-script/m-p/5192158#M680261</link>
    <description>&lt;!--!*#--&gt;Hi (again):&lt;BR /&gt;&lt;BR /&gt;A better solution to your problem may be to add a one-line patch at line-388:&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;385  # Been there before but have we exceeded to INCR value?  Note: we may&lt;BR /&gt;386  # be at 99% so the script will repeat.&lt;BR /&gt;387&lt;BR /&gt;388            [ -z "${INCR}" ] &amp;amp;&amp;amp; INCR=${DEFINCR} #...patch...&lt;BR /&gt;389            LASTVALUE=$(echo $BEENTHERE | awk '{print $2}')&lt;BR /&gt;390            if [ $((LASTVALUE + INCR)) -le $PERCENT ]&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;This resets the default increment if it isn't defined.  Now you can follow the documentation for the 'diskspace.conf' layout exactly.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
    <pubDate>Mon, 10 Aug 2009 21:28:45 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2009-08-10T21:28:45Z</dc:date>
    <item>
      <title>New to UNIX, need help with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/new-to-unix-need-help-with-script/m-p/5192148#M680251</link>
      <description>Guru's, I am new to UNIX and attempting to learn a bit of scripting. Please see attached. The problem is that I do not know how to properly modify this script. It is to check filesystem usage, and e-mail when over 95% usage. However, the cron job has it running every 20 minutes, and it writes a new "emailfile" to /tmp everytime. How do I get it to run and ONLY create the file if something IS over 95% or possibly create the file everytime, but remove it afterwards??? Any help is appreciated.....</description>
      <pubDate>Mon, 10 Aug 2009 12:20:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/new-to-unix-need-help-with-script/m-p/5192148#M680251</guid>
      <dc:creator>Jarheadatheart</dc:creator>
      <dc:date>2009-08-10T12:20:43Z</dc:date>
    </item>
    <item>
      <title>Re: New to UNIX, need help with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/new-to-unix-need-help-with-script/m-p/5192149#M680252</link>
      <description>Hi,&lt;BR /&gt;this will require more than a small change in the script. The whole concept in the script is at the moment to create the email file and check after it.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Line 33-35:&lt;BR /&gt;# Create the "emailfile"&lt;BR /&gt;echo "SEE THE FOLLOWING FILE: /tmp/"`date "+bdf%m%d%y%H"` &amp;gt; $emailfile&lt;BR /&gt;echo "" &amp;gt;&amp;gt; $emailfile&lt;BR /&gt;&lt;BR /&gt;After a quick check there should be a file for every hour - or is it for every run?</description>
      <pubDate>Mon, 10 Aug 2009 12:38:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/new-to-unix-need-help-with-script/m-p/5192149#M680252</guid>
      <dc:creator>Stephan._1</dc:creator>
      <dc:date>2009-08-10T12:38:20Z</dc:date>
    </item>
    <item>
      <title>Re: New to UNIX, need help with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/new-to-unix-need-help-with-script/m-p/5192150#M680253</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;First, please post your attachment as a TEXT file and not a Microsoft Word document.&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 10 Aug 2009 12:38:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/new-to-unix-need-help-with-script/m-p/5192150#M680253</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-08-10T12:38:27Z</dc:date>
    </item>
    <item>
      <title>Re: New to UNIX, need help with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/new-to-unix-need-help-with-script/m-p/5192151#M680254</link>
      <description>SVO, it is every run..... not just every hour&lt;BR /&gt;&lt;BR /&gt;My apologies, here it is again in Text.</description>
      <pubDate>Mon, 10 Aug 2009 12:43:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/new-to-unix-need-help-with-script/m-p/5192151#M680254</guid>
      <dc:creator>Jarheadatheart</dc:creator>
      <dc:date>2009-08-10T12:43:51Z</dc:date>
    </item>
    <item>
      <title>Re: New to UNIX, need help with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/new-to-unix-need-help-with-script/m-p/5192152#M680255</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;The script will need some work.  You might be better served by using and studying one that meets your objectives.  Bill Hassell has one as an attachment in this thread :&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1100009" target="_blank"&gt;http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1100009&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 10 Aug 2009 13:09:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/new-to-unix-need-help-with-script/m-p/5192152#M680255</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-08-10T13:09:01Z</dc:date>
    </item>
    <item>
      <title>Re: New to UNIX, need help with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/new-to-unix-need-help-with-script/m-p/5192153#M680256</link>
      <description>Thanks James, that is incredibly helpful.... Gonna take be a bit to get through it all, but juding by the description, this will work wonderfully.</description>
      <pubDate>Mon, 10 Aug 2009 13:41:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/new-to-unix-need-help-with-script/m-p/5192153#M680256</guid>
      <dc:creator>Jarheadatheart</dc:creator>
      <dc:date>2009-08-10T13:41:23Z</dc:date>
    </item>
    <item>
      <title>Re: New to UNIX, need help with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/new-to-unix-need-help-with-script/m-p/5192154#M680257</link>
      <description>James,&lt;BR /&gt;   I have been trying this all day. I get error: /usr/local/bin/diskspace.sh[391]: /home: Syntax error&lt;BR /&gt;&lt;BR /&gt;IF I DON'T clear out all temp files used located on /var/tmp/diskspace&lt;BR /&gt;&lt;BR /&gt;If I do clear them out, I don't get the syntax error but either way I DON'T get the e-mail notification. &lt;BR /&gt;&lt;BR /&gt;Thoughts?</description>
      <pubDate>Mon, 10 Aug 2009 18:33:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/new-to-unix-need-help-with-script/m-p/5192154#M680257</guid>
      <dc:creator>Jarheadatheart</dc:creator>
      <dc:date>2009-08-10T18:33:21Z</dc:date>
    </item>
    <item>
      <title>Re: New to UNIX, need help with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/new-to-unix-need-help-with-script/m-p/5192155#M680258</link>
      <description>Upon further review, it is supposed to error out IF that filesystem has already been marked.&lt;BR /&gt;&lt;BR /&gt;However, the sendmail syntax still won't send the mail...... and the debug doesn't show anything.</description>
      <pubDate>Mon, 10 Aug 2009 19:04:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/new-to-unix-need-help-with-script/m-p/5192155#M680258</guid>
      <dc:creator>Jarheadatheart</dc:creator>
      <dc:date>2009-08-10T19:04:53Z</dc:date>
    </item>
    <item>
      <title>Re: New to UNIX, need help with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/new-to-unix-need-help-with-script/m-p/5192156#M680259</link>
      <description>attached is the debug</description>
      <pubDate>Mon, 10 Aug 2009 19:22:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/new-to-unix-need-help-with-script/m-p/5192156#M680259</guid>
      <dc:creator>Jarheadatheart</dc:creator>
      <dc:date>2009-08-10T19:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: New to UNIX, need help with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/new-to-unix-need-help-with-script/m-p/5192157#M680260</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;If you don't have any HFS filesystems then delete the 'hfs' token from the '/etc/diskspace.conf' file that you should have created (see the internal instructions).&lt;BR /&gt;&lt;BR /&gt;Then run the script like:&lt;BR /&gt;&lt;BR /&gt;# ./diskspace.sh -e"jarheadatheart@us.org"&lt;BR /&gt;&lt;BR /&gt;This gives me alerts, BUT upon rerunning, I see the behavior you noted:&lt;BR /&gt;&lt;BR /&gt;...[390]:LASTVALUE + INCR: The specified number is not valid for this command.&lt;BR /&gt;&lt;BR /&gt;The key appears to be to make sure that you have a 'diskspace.conf' file that has mountpoints with maximum and minimums defined, like:&lt;BR /&gt;&lt;BR /&gt;/usr 90 2&lt;BR /&gt;&lt;BR /&gt;...but not:&lt;BR /&gt;&lt;BR /&gt;/usr 90&lt;BR /&gt;&lt;BR /&gt;...despite what the documentation might suggest.&lt;BR /&gt;&lt;BR /&gt;For example, this works only the first time and fails thereafter:&lt;BR /&gt;&lt;BR /&gt;vxfs&lt;BR /&gt;25 1&lt;BR /&gt;/patches 26&lt;BR /&gt;&lt;BR /&gt;...but this fixes the problem:&lt;BR /&gt;&lt;BR /&gt;vxfs&lt;BR /&gt;25 1&lt;BR /&gt;/patches 26 1&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 10 Aug 2009 20:28:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/new-to-unix-need-help-with-script/m-p/5192157#M680260</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-08-10T20:28:35Z</dc:date>
    </item>
    <item>
      <title>Re: New to UNIX, need help with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/new-to-unix-need-help-with-script/m-p/5192158#M680261</link>
      <description>&lt;!--!*#--&gt;Hi (again):&lt;BR /&gt;&lt;BR /&gt;A better solution to your problem may be to add a one-line patch at line-388:&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;385  # Been there before but have we exceeded to INCR value?  Note: we may&lt;BR /&gt;386  # be at 99% so the script will repeat.&lt;BR /&gt;387&lt;BR /&gt;388            [ -z "${INCR}" ] &amp;amp;&amp;amp; INCR=${DEFINCR} #...patch...&lt;BR /&gt;389            LASTVALUE=$(echo $BEENTHERE | awk '{print $2}')&lt;BR /&gt;390            if [ $((LASTVALUE + INCR)) -le $PERCENT ]&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;This resets the default increment if it isn't defined.  Now you can follow the documentation for the 'diskspace.conf' layout exactly.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Mon, 10 Aug 2009 21:28:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/new-to-unix-need-help-with-script/m-p/5192158#M680261</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-08-10T21:28:45Z</dc:date>
    </item>
    <item>
      <title>Re: New to UNIX, need help with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/new-to-unix-need-help-with-script/m-p/5192159#M680262</link>
      <description>James, one last thing. How would I set that to a cronjob? I can't set the cron to run as &lt;BR /&gt;/usr/local/bin/diskspace.sh -e "me@me.org" &lt;BR /&gt;&lt;BR /&gt;Can I?</description>
      <pubDate>Tue, 11 Aug 2009 13:26:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/new-to-unix-need-help-with-script/m-p/5192159#M680262</guid>
      <dc:creator>Jarheadatheart</dc:creator>
      <dc:date>2009-08-11T13:26:41Z</dc:date>
    </item>
    <item>
      <title>Re: New to UNIX, need help with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/new-to-unix-need-help-with-script/m-p/5192160#M680263</link>
      <description>I apologize for my ignorance. I am VERY new to UNIX.</description>
      <pubDate>Tue, 11 Aug 2009 13:30:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/new-to-unix-need-help-with-script/m-p/5192160#M680263</guid>
      <dc:creator>Jarheadatheart</dc:creator>
      <dc:date>2009-08-11T13:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: New to UNIX, need help with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/new-to-unix-need-help-with-script/m-p/5192161#M680264</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;&amp;gt; How would I set that to a cronjob? I can't set the cron to run as&lt;BR /&gt;/usr/local/bin/diskspace.sh -e "me@me.org" &lt;BR /&gt;&lt;BR /&gt;For example:&lt;BR /&gt;&lt;BR /&gt;00,10,20,30,40,50  * * * * /usr/local/bin/diskspace.sh -e"me@me.org"&lt;BR /&gt;&lt;BR /&gt;...would run the process every 10-minutes after every hour on every day of the week, etc.&lt;BR /&gt;There is more information in the 'crontab' manpages.  You're doing fine :-)&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 11 Aug 2009 13:40:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/new-to-unix-need-help-with-script/m-p/5192161#M680264</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-08-11T13:40:43Z</dc:date>
    </item>
    <item>
      <title>Re: New to UNIX, need help with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/new-to-unix-need-help-with-script/m-p/5192162#M680265</link>
      <description>You can use&lt;BR /&gt;/usr/local/bin/diskspace.sh -e "me@me.org"&lt;BR /&gt;as your command in the crontab entry.&lt;BR /&gt;&lt;BR /&gt;If your scirpt has any output you may want to add &lt;BR /&gt;&amp;gt; /dev/null&lt;BR /&gt;to the end of the command so you don't get mailed from cron every time it runs.  &lt;BR /&gt;If there is error output cron will still mail that.</description>
      <pubDate>Tue, 11 Aug 2009 13:41:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/new-to-unix-need-help-with-script/m-p/5192162#M680265</guid>
      <dc:creator>Tom Ward_1</dc:creator>
      <dc:date>2009-08-11T13:41:00Z</dc:date>
    </item>
    <item>
      <title>Re: New to UNIX, need help with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/new-to-unix-need-help-with-script/m-p/5192163#M680266</link>
      <description>Thanks... I have got the times/dates portion of cron down I think! HAHAHA!&lt;BR /&gt;&lt;BR /&gt;So I can in fact run it like that. ok. &lt;BR /&gt;&lt;BR /&gt;And the &amp;gt;/dev/null will make it only send me an e-mail if the script finds something?</description>
      <pubDate>Tue, 11 Aug 2009 13:51:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/new-to-unix-need-help-with-script/m-p/5192163#M680266</guid>
      <dc:creator>Jarheadatheart</dc:creator>
      <dc:date>2009-08-11T13:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: New to UNIX, need help with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/new-to-unix-need-help-with-script/m-p/5192164#M680267</link>
      <description>would the entry be &amp;gt;&amp;gt;/dev/null 2&amp;gt;&amp;amp;1  or just &amp;gt;&amp;gt;/dev/null</description>
      <pubDate>Tue, 11 Aug 2009 13:52:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/new-to-unix-need-help-with-script/m-p/5192164#M680267</guid>
      <dc:creator>Jarheadatheart</dc:creator>
      <dc:date>2009-08-11T13:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: New to UNIX, need help with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/new-to-unix-need-help-with-script/m-p/5192165#M680268</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; And the &amp;gt;/dev/null will make it only send me an e-mail if the script finds something?&lt;BR /&gt;&lt;BR /&gt;You don't need to add that in this case.  By default, 'cron' creates mail and sends it to the user's crontask _IF_ either STDOUT and/or STDERR has not been redirected (to a file).&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 11 Aug 2009 13:54:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/new-to-unix-need-help-with-script/m-p/5192165#M680268</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-08-11T13:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: New to UNIX, need help with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/new-to-unix-need-help-with-script/m-p/5192166#M680269</link>
      <description>ah. Ok, thanks James!</description>
      <pubDate>Tue, 11 Aug 2009 13:55:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/new-to-unix-need-help-with-script/m-p/5192166#M680269</guid>
      <dc:creator>Jarheadatheart</dc:creator>
      <dc:date>2009-08-11T13:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: New to UNIX, need help with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/new-to-unix-need-help-with-script/m-p/5192167#M680270</link>
      <description>Thanks a lot guys!</description>
      <pubDate>Tue, 11 Aug 2009 14:17:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/new-to-unix-need-help-with-script/m-p/5192167#M680270</guid>
      <dc:creator>Jarheadatheart</dc:creator>
      <dc:date>2009-08-11T14:17:17Z</dc:date>
    </item>
  </channel>
</rss>

