<?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 required to move files from (/oracle/SID/oraarch) to (/oracle/SID/sapdata6) in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-required-to-move-files-from-oracle-sid-oraarch-to-oracle/m-p/6545140#M496721</link>
    <description>&lt;P&gt;You and Dennis are correct. Just echo the BDF variable using quotes and grep for the mountpoint:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;"echo "$BDF"&amp;nbsp; | grep /tmp&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 18 Jul 2014 00:13:53 GMT</pubDate>
    <dc:creator>Bill Hassell</dc:creator>
    <dc:date>2014-07-18T00:13:53Z</dc:date>
    <item>
      <title>script required to move files from (/oracle/SID/oraarch) to (/oracle/SID/sapdata6)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-required-to-move-files-from-oracle-sid-oraarch-to-oracle/m-p/6493610#M496711</link>
      <description>&lt;P&gt;Hi every one,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I new scripting in HP unix operating system.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I require a script, which do the following given below example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When &lt;SPAN&gt;'&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;/oracle/&amp;lt;SID&amp;gt;/oraarch&lt;/FONT&gt;&lt;SPAN&gt;' filesystem usage is 80%. &amp;nbsp;It has to move&amp;nbsp;&lt;/SPAN&gt;'&lt;FONT color="#FF0000"&gt;*.dbf&lt;/FONT&gt;' files from&amp;nbsp;'&lt;FONT color="#FF0000"&gt;/oracle/&amp;lt;SID&amp;gt;/oraarch&lt;/FONT&gt;' to '&lt;FONT color="#FF0000"&gt;/oracle/&amp;lt;SID&amp;gt;/sapdata6&lt;/FONT&gt;'.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And&lt;/P&gt;&lt;P&gt;if&amp;nbsp;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;/oracle/&amp;lt;SID&amp;gt;/sapdata6&lt;/FONT&gt;&lt;SPAN&gt;' filesystem usage is 90%. It has to move&amp;nbsp;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;*.dbf&lt;/FONT&gt;&lt;SPAN&gt;' files from&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;/oracle/&amp;lt;SID&amp;gt;/oraarch&lt;/FONT&gt;&lt;SPAN&gt;' to '&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;/oracle/&amp;lt;SID&amp;gt;/sapdata7&lt;/FONT&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;And&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;if&amp;nbsp;&lt;/SPAN&gt;'&lt;FONT color="#FF0000"&gt;/oracle/&amp;lt;SID&amp;gt;/sapdata7&lt;/FONT&gt;' filesystem usage is 90%.&amp;nbsp;It has to move&amp;nbsp;'&lt;FONT color="#FF0000"&gt;*.dbf&lt;/FONT&gt;' files from&amp;nbsp;'&lt;FONT color="#FF0000"&gt;/oracle/&amp;lt;SID&amp;gt;/oraarch&lt;/FONT&gt;' to '&lt;FONT color="#FF0000"&gt;/oracle/&amp;lt;SID&amp;gt;/sapdata8&lt;/FONT&gt;'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;And&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;if&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;/oracle/&amp;lt;SID&amp;gt;/sapdata8&lt;/FONT&gt;&lt;SPAN&gt;' filesystem usage is 90%. It has to delete '&lt;FONT color="#FF0000"&gt;*.dbf&lt;/FONT&gt;' files from '&lt;FONT color="#FF0000"&gt;/oracle/&amp;lt;SID&amp;gt;/sapdata6&lt;/FONT&gt;' and it&amp;nbsp;has to move&amp;nbsp;'&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;*.dbf&lt;/FONT&gt;&lt;SPAN&gt;' files from&amp;nbsp;'&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;/oracle/&amp;lt;SID&amp;gt;/oraarch&lt;/FONT&gt;&lt;SPAN&gt;' to '&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;/oracle/&amp;lt;SID&amp;gt;/sapdata6&lt;/FONT&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;And&amp;nbsp;&lt;/P&gt;&lt;P&gt;if&amp;nbsp;'&lt;FONT color="#FF0000"&gt;/oracle/&amp;lt;SID&amp;gt;/sapdata6&lt;/FONT&gt;' filesystem usage is 90%. It has to delete '&lt;FONT color="#FF0000"&gt;*.dbf&lt;/FONT&gt;' files from&amp;nbsp;'&lt;FONT color="#FF0000"&gt;/oracle/&amp;lt;SID&amp;gt;/sapdata7&lt;/FONT&gt;' and it &amp;nbsp;has to move&amp;nbsp;'&lt;FONT color="#FF0000"&gt;*.dbf&lt;/FONT&gt;' files from&amp;nbsp;'&lt;FONT color="#FF0000"&gt;/oracle/&amp;lt;SID&amp;gt;/oraarch&lt;/FONT&gt;' to '&lt;FONT color="#FF0000"&gt;/oracle/&amp;lt;SID&amp;gt;/sapdata7&lt;/FONT&gt;'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And&amp;nbsp;&lt;/P&gt;&lt;P&gt;if&amp;nbsp;'&lt;FONT color="#FF0000"&gt;/oracle/&amp;lt;SID&amp;gt;/sapdata7&lt;/FONT&gt;' filesystem usage is 90%. It has to delete '&lt;FONT color="#FF0000"&gt;*.dbf&lt;/FONT&gt;' files from&amp;nbsp;'&lt;FONT color="#FF0000"&gt;/oracle/&amp;lt;SID&amp;gt;/sapdata8&lt;/FONT&gt;' and it has to move&amp;nbsp;'&lt;FONT color="#FF0000"&gt;*.dbf&lt;/FONT&gt;' files from&amp;nbsp;'&lt;FONT color="#FF0000"&gt;/oracle/&amp;lt;SID&amp;gt;/oraarch&lt;/FONT&gt;' to '&lt;FONT color="#FF0000"&gt;/oracle/&amp;lt;SID&amp;gt;/sapdata8&lt;/FONT&gt;'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help me for this script. It is very important for daily routine task.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;Thanks in Advance.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 30 May 2014 12:46:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-required-to-move-files-from-oracle-sid-oraarch-to-oracle/m-p/6493610#M496711</guid>
      <dc:creator>srinivasvankina</dc:creator>
      <dc:date>2014-05-30T12:46:24Z</dc:date>
    </item>
    <item>
      <title>Re: script required to move files from (/oracle/SID/oraarch) to (/oracle/SID/sapdata6)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-required-to-move-files-from-oracle-sid-oraarch-to-oracle/m-p/6494160#M496712</link>
      <description>&lt;P&gt;You need to break your requirements into smaller tasks that can be done by separate functions or scripts.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;1) You seem to need a function to return usage of a filesystem.&lt;/P&gt;&lt;P&gt;2) A function to move files&lt;/P&gt;&lt;P&gt;3) A function to delete files.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You then call the above functions passing the various sources and targets:&lt;/P&gt;&lt;P&gt;SID=XXX&lt;/P&gt;&lt;P&gt;FS=/oracle/$SID/oraarch&lt;/P&gt;&lt;P&gt;src=$FS&lt;/P&gt;&lt;P&gt;TGT=/oracle/$SID/sapdata6&lt;/P&gt;&lt;P&gt;usage_limit=80&lt;/P&gt;&lt;P&gt;usage=$(get_fs_usage $FS)&lt;/P&gt;&lt;P&gt;if [ $usage -ge $usage_limit ]; then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; move_files $src $TGT&lt;/P&gt;&lt;P&gt;fi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FS=/oracle/$SID/sapdata6&lt;/P&gt;&lt;P&gt;TGT=/oracle/$SID/sapdata7&lt;/P&gt;&lt;P&gt;usage_limit=90&lt;/P&gt;&lt;P&gt;usage=$(get_fs_usage $SRC)&lt;/P&gt;&lt;P&gt;if [ $usage -ge $usage_limit ]; then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; move_files $src $TGT&lt;/P&gt;&lt;P&gt;fi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FS=/oracle/$SID/sapdata7&lt;/P&gt;&lt;P&gt;TGT=/oracle/$SID/sapdata8&lt;/P&gt;&lt;P&gt;usage=$(get_fs_usage $SRC)&lt;/P&gt;&lt;P&gt;if [ $usage -ge $usage_limit ]; then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; move_files $src $TGT&lt;/P&gt;&lt;P&gt;fi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FS=/oracle/$SID/sapdata8&lt;/P&gt;&lt;P&gt;TGT=/oracle/$SID/sapdata6&lt;/P&gt;&lt;P&gt;usage=$(get_fs_usage $SRC)&lt;/P&gt;&lt;P&gt;if [ $usage -ge $usage_limit ]; then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; remove_files $TGT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; move_files $src $TGT&lt;/P&gt;&lt;P&gt;fi&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You could combine the steps that have to delete with the ones that don't by passing a parm to indicate that step.&amp;nbsp; And then you can use the same function to do all 6 steps.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jun 2014 16:54:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-required-to-move-files-from-oracle-sid-oraarch-to-oracle/m-p/6494160#M496712</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2014-06-02T16:54:08Z</dc:date>
    </item>
    <item>
      <title>Re: script required to move files from (/oracle/SID/oraarch) to (/oracle/SID/sapdata6)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-required-to-move-files-from-oracle-sid-oraarch-to-oracle/m-p/6495634#M496713</link>
      <description>&lt;P&gt;To get percentage value of filesystem. I written the script given below.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SID=XXX&lt;BR /&gt;FS=/oracle/$SID/oraarch&lt;BR /&gt;src=$FS&lt;BR /&gt;TGT=/oracle/$SID/sapdata6&lt;BR /&gt;usage_limit=80&lt;BR /&gt;usage=$(bdf | egrep "/oracle/RRP/oraarch" | awk '{print $5}')&lt;/P&gt;&lt;P&gt;echo "$usage"&lt;BR /&gt;if [ $usage -ge $usage_limit ]; then&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mv $SRC $TGT&lt;BR /&gt;fi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After executing the script, I got the following error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# ./scriptoraarch.sh&lt;BR /&gt;28%&lt;BR /&gt;./scriptoraarch.sh[8]: 28%: Expression is not complete; more tokens expected.&lt;BR /&gt;You have mail in /var/mail/root&lt;BR /&gt;#&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to remove the percentage(%) symbol from the number (ex.28%). which comes output of following line &lt;SPAN&gt;usage=$(bdf | egrep "/oracle/XXX/oraarch" | awk '{print $5}')&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help me.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jun 2014 11:47:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-required-to-move-files-from-oracle-sid-oraarch-to-oracle/m-p/6495634#M496713</guid>
      <dc:creator>srinivasvankina</dc:creator>
      <dc:date>2014-06-02T11:47:39Z</dc:date>
    </item>
    <item>
      <title>Re: script required to move files from (/oracle/SID/oraarch) to (/oracle/SID/sapdata6)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-required-to-move-files-from-oracle-sid-oraarch-to-oracle/m-p/6495950#M496714</link>
      <description />
      <pubDate>Mon, 02 Jun 2014 15:35:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-required-to-move-files-from-oracle-sid-oraarch-to-oracle/m-p/6495950#M496714</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2014-06-02T15:35:57Z</dc:date>
    </item>
    <item>
      <title>Re: script required to move files from (/oracle/SID/oraarch) to (/oracle/SID/sapdata6)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-required-to-move-files-from-oracle-sid-oraarch-to-oracle/m-p/6496008#M496715</link>
      <description>&lt;P&gt;&amp;gt;I need to remove the percentage(%) symbol from the number&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can simply do it with awk, also no need to use the egrep hammer:&lt;/P&gt;&lt;P&gt;usage=$(bdf $FS | awk '{print substr($5, 1, length($5)-1}')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note: If your filesystem string is too long to fit, bdf(1) will display on two lines.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jul 2014 22:27:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-required-to-move-files-from-oracle-sid-oraarch-to-oracle/m-p/6496008#M496715</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2014-07-03T22:27:16Z</dc:date>
    </item>
    <item>
      <title>Re: script required to move files from (/oracle/SID/oraarch) to (/oracle/SID/sapdata6)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-required-to-move-files-from-oracle-sid-oraarch-to-oracle/m-p/6528708#M496716</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had done my self. I done the script in another way. Script given below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#Initiliaze Values in varaiables&lt;BR /&gt;SID=XXX&lt;BR /&gt;FS=/oracle/$SID/oraarch&lt;BR /&gt;src=$FS&lt;BR /&gt;TGT_SD6=/oracle/$SID/sapdata6&lt;BR /&gt;TGT_SD7=/oracle/$SID/sapdata7&lt;BR /&gt;TGT_SD8=/oracle/$SID/sapdata8&lt;/P&gt;&lt;P&gt;#Calculating the usage limit of the filesystem /oracle/$SID/oraarch by 70 percentage&lt;BR /&gt;ora_lt=$(bdf | egrep "/oracle/$SID/oraarch" | awk '{print $2}')&lt;BR /&gt;ora_lt_div=$((ora_lt/100))&lt;BR /&gt;ora_lt_p=$((ora_lt_div*70))&lt;BR /&gt;#echo "$ora_lt_p"&lt;/P&gt;&lt;P&gt;#Calculating the usage of the filesystem /oracle/$SID/oraarch&lt;BR /&gt;ora_gw=$(bdf | egrep "/oracle/$SID/oraarch" | awk '{print $3}')&lt;/P&gt;&lt;P&gt;#Calculating the usage limit of the filesystem /oracle/$SID/sapdata6 by 60 percentage&lt;BR /&gt;SD6_lt=$(bdf | egrep "/oracle/$SID/sapdata6" | awk '{print $2}')&lt;BR /&gt;SD6_lt_div=$((SD6_lt/100))&lt;BR /&gt;SD6_lt_p=$((SD6_lt_div*60))&lt;BR /&gt;#echo "$SD6_lt_p"&lt;/P&gt;&lt;P&gt;#Calculating the usage of the filesystem /oracle/$SID/sapdata6&lt;BR /&gt;SD6_gw=$(bdf | egrep "/oracle/$SID/sapdata6" | awk '{print $3}')&lt;/P&gt;&lt;P&gt;#Calculating the usage limit of the filesystem /oracle/$SID/sapdata7 by 50 percentage&lt;BR /&gt;SD7_lt=$(bdf | egrep "/oracle/$SID/sapdata7" | awk '{print $2}')&lt;BR /&gt;SD7_lt_div=$((SD7_lt/100))&lt;BR /&gt;SD7_lt_p=$((SD7_lt_div*50))&lt;BR /&gt;#echo "$SD7_lt_p"&lt;/P&gt;&lt;P&gt;#Calculating the usage of the filesystem /oracle/$SID/sapdata7&lt;BR /&gt;SD7_gw=$(bdf | egrep "/oracle/$SID/sapdata7" | awk '{print $3}')&lt;/P&gt;&lt;P&gt;#Calculating the usage limit of the filesystem /oracle/$SID/sapdata8 by 40 percentage&lt;BR /&gt;SD8_lt=$(bdf | egrep "/oracle/$SID/sapdata8" | awk '{print $2}')&lt;BR /&gt;SD8_lt_div=$((SD8_lt/100))&lt;BR /&gt;SD8_lt_p=$((SD8_lt_div*40))&lt;BR /&gt;#echo "$SD8_lt_p"&lt;/P&gt;&lt;P&gt;#Calculating the usage of the filesystem /oracle/$SID/sapdata8&lt;BR /&gt;SD8_gw=$(bdf | egrep "/oracle/$SID/sapdata8" | awk '{print $3}')&lt;/P&gt;&lt;P&gt;#Checking usage growth with usage limit and moves *.dbf files to sapdata6, sapdata7 &amp;amp; sapdata8 file systems&lt;BR /&gt;if [ $ora_gw -ge $ora_lt_p ] &amp;amp;&amp;amp; [ $SD6_gw -le $SD6_lt_p ]&lt;BR /&gt;then&lt;BR /&gt;find $SRC -type f -name RRParch1*.dbf -mtime +1 -exec mv -f {} $TGT_SD6 \;&lt;BR /&gt;elif [ $ora_gw -ge $ora_lt_p ] &amp;amp;&amp;amp; [ $SD6_gw -ge $SD6_lt_p ] &amp;amp;&amp;amp; [ $SD7_gw -le $SD7_lt_p ]&lt;BR /&gt;then&lt;BR /&gt;find $TGT_SD6 -type f -name RRParch1*.dbf -exec mv -f {} $TGT_SD7 \;&lt;BR /&gt;find $SRC -type f -name RRParch1*.dbf -mtime +1 -exec mv -f {} $TGT_SD6 \;&lt;BR /&gt;elif [ $ora_gw -ge $ora_lt_p ] &amp;amp;&amp;amp; [ $SD6_gw -ge $SD6_lt_p ] &amp;amp;&amp;amp; [ $SD7_gw -ge $SD7_lt_p ] &amp;amp;&amp;amp; [ $SD8_gw -le $SD8_lt_p ]&lt;BR /&gt;then&lt;BR /&gt;find $TGT_SD7 -type f -name RRParch1*.dbf -exec mv -f {} $TGT_SD8 \;&lt;BR /&gt;find $TGT_SD6 -type f -name RRParch1*.dbf -exec mv -f {} $TGT_SD7 \;&lt;BR /&gt;find $SRC -type f -name RRParch1*.dbf -mtime +1 -exec mv -f {} $TGT_SD6 \;&lt;BR /&gt;elif [ $ora_gw -ge $ora_lt_p ] &amp;amp;&amp;amp; [ $SD6_gw -ge $SD6_lt_p ] &amp;amp;&amp;amp; [ $SD7_gw -ge $SD7_lt_p ] &amp;amp;&amp;amp; [ $SD8_gw -ge $SD8_lt_p ]&lt;BR /&gt;then&lt;BR /&gt;find $TGT_SD8 -type f -name RRParch1*.dbf -exec rm -f {} \;&lt;BR /&gt;find $TGT_SD7 -type f -name RRParch1*.dbf -exec mv -f {} $TGT_SD8 \;&lt;BR /&gt;find $TGT_SD6 -type f -name RRParch1*.dbf -exec mv -f {} $TGT_SD7 \;&lt;BR /&gt;find $SRC -type f -name RRParch1*.dbf -mtime +1 -exec mv -f {} $TGT_SD6 \;&lt;BR /&gt;fi&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jul 2014 10:44:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-required-to-move-files-from-oracle-sid-oraarch-to-oracle/m-p/6528708#M496716</guid>
      <dc:creator>srinivasvankina</dc:creator>
      <dc:date>2014-07-03T10:44:45Z</dc:date>
    </item>
    <item>
      <title>Re: script required to move files from (/oracle/SID/oraarch) to (/oracle/SID/sapdata6)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-required-to-move-files-from-oracle-sid-oraarch-to-oracle/m-p/6528794#M496717</link>
      <description>&lt;P&gt;&lt;STRONG&gt;bdf&lt;/STRONG&gt; can be very slow on big systems, especially if there are NFS mounts.&lt;/P&gt;&lt;P&gt;Here is a way to write scripts to only call &lt;STRONG&gt;bdf&lt;/STRONG&gt; once, only for local filesystems, and handle split lines:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;export BDF=$(bdf -l | while read FS TOT USED AVAIL PERCENT MNT
  do
    if [[ $FS != "Filesystem" ]]
    then
       if [[ "$TOT" = "" ]]
       then
         read TOT USED AVAIL PERCENT MNT
       fi
       echo "$(echo $FS $TOT $USED $AVAIL $PERCENT $MNT | tr -d '%')"
    fi
  done)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Now in the rest of the script, you replace the &lt;STRONG&gt;bdf&lt;/STRONG&gt; command with &lt;STRONG&gt;$(echo "$BDF") &lt;/STRONG&gt;as in:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;$(echo "$BDF") | grep $FS&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(note: &lt;STRONG&gt;$BDF&lt;/STRONG&gt; has the % character removed to make parsing the percentage value easier)&lt;/P&gt;&lt;P&gt;Since the &lt;STRONG&gt;bdf&lt;/STRONG&gt; text is all in memory, the results are very fast and don't require any help from HP-UX.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jul 2014 12:30:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-required-to-move-files-from-oracle-sid-oraarch-to-oracle/m-p/6528794#M496717</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2014-07-03T12:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: script required to move files from (/oracle/SID/oraarch) to (/oracle/SID/sapdata6)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-required-to-move-files-from-oracle-sid-oraarch-to-oracle/m-p/6529594#M496718</link>
      <description>&lt;P&gt;You can make several optimizations:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; ((&lt;SPAN&gt;ora&lt;/SPAN&gt;_&lt;SPAN&gt;lt&lt;/SPAN&gt;_div = &lt;SPAN&gt;ora&lt;/SPAN&gt;_&lt;SPAN&gt;lt&lt;/SPAN&gt; / 100))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And no need to compute ora_lt_div:&lt;/P&gt;&lt;P&gt;((ora_lt_p = ora_lt / 100 * 70))&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;ora_lt=$(bdf | egrep "/oracle/$SID/oraarch" | awk '{print $2}')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is no need to use egrep and if /oracle is a filesystem, you can simply to:&lt;/P&gt;&lt;P&gt;ora_lt=$(bdf&amp;nbsp; "/oracle/$SID/oraarch" | awk '{print $2}')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And awk can do the percentage calc too:&lt;/P&gt;&lt;P&gt;ora_lt=$(bdf&amp;nbsp; "/oracle/$SID/oraarch" | awk 'BEGIN {OFMT="%.0f"} {print $2 * .70 }')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And of course, there is no reason awk can't compute the limit and usage in the same line.&amp;nbsp; You would need to assign to an array.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;find $&lt;SPAN&gt;TGT&lt;/SPAN&gt;_SD8 -type f -name RRParch1*.&lt;SPAN&gt;dbf&lt;/SPAN&gt; -exec rm -f {} +&amp;nbsp; # Using "+" is much faster&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For numeric variables you can use C style expressions:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if (( &lt;SPAN&gt;ora&lt;/SPAN&gt;_&lt;SPAN&gt;gw&lt;/SPAN&gt; &amp;gt;= &lt;SPAN&gt;ora&lt;/SPAN&gt;_&lt;SPAN&gt;lt&lt;/SPAN&gt;_p &amp;amp;&amp;amp; SD6_&lt;SPAN&gt;gw&lt;/SPAN&gt; &amp;lt;= SD6_&lt;SPAN&gt;lt&lt;/SPAN&gt;_p )); then&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jul 2014 08:00:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-required-to-move-files-from-oracle-sid-oraarch-to-oracle/m-p/6529594#M496718</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2014-07-04T08:00:23Z</dc:date>
    </item>
    <item>
      <title>Re: script required to move files from (/oracle/SID/oraarch) to (/oracle/SID/sapdata6)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-required-to-move-files-from-oracle-sid-oraarch-to-oracle/m-p/6543214#M496719</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; Now in the rest of the script, you replace the bdf command with $(echo "$BDF") as in:

$(echo "$BDF") | grep $FS&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i get an error , when i use this it ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;do you mean?&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;echo "$BDF"&amp;nbsp; | grep $FS&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it test it with "&lt;STRONG&gt;echo "$BDF"&amp;nbsp; | grep/tmp&lt;/STRONG&gt;"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jul 2014 12:09:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-required-to-move-files-from-oracle-sid-oraarch-to-oracle/m-p/6543214#M496719</guid>
      <dc:creator>support_billa</dc:creator>
      <dc:date>2014-07-16T12:09:24Z</dc:date>
    </item>
    <item>
      <title>Re: script required to move files from (/oracle/SID/oraarch) to (/oracle/SID/sapdata6)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-required-to-move-files-from-oracle-sid-oraarch-to-oracle/m-p/6544256#M496720</link>
      <description>&lt;P&gt;&amp;gt;do you mean? echo "$BDF" | grep $FS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, that makes more sense.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jul 2014 08:15:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-required-to-move-files-from-oracle-sid-oraarch-to-oracle/m-p/6544256#M496720</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2014-07-17T08:15:01Z</dc:date>
    </item>
    <item>
      <title>Re: script required to move files from (/oracle/SID/oraarch) to (/oracle/SID/sapdata6)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-required-to-move-files-from-oracle-sid-oraarch-to-oracle/m-p/6545140#M496721</link>
      <description>&lt;P&gt;You and Dennis are correct. Just echo the BDF variable using quotes and grep for the mountpoint:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;"echo "$BDF"&amp;nbsp; | grep /tmp&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Jul 2014 00:13:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-required-to-move-files-from-oracle-sid-oraarch-to-oracle/m-p/6545140#M496721</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2014-07-18T00:13:53Z</dc:date>
    </item>
  </channel>
</rss>

