<?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: Housekeeping Scripts in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/housekeeping-scripts/m-p/2593012#M33124</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Sorry, one more question.  Does this table exist as a text file, and if so, can you attach an example.  I need to know if each line only contains 3 entries, or if there are multiple directories listed per line.&lt;BR /&gt;&lt;BR /&gt;Thanks, Robin.</description>
    <pubDate>Thu, 11 Oct 2001 08:08:32 GMT</pubDate>
    <dc:creator>Robin Wakefield</dc:creator>
    <dc:date>2001-10-11T08:08:32Z</dc:date>
    <item>
      <title>Housekeeping Scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/housekeeping-scripts/m-p/2593009#M33121</link>
      <description>Hai All,&lt;BR /&gt;&lt;BR /&gt;I have to write a script which has to collect the directory names from the two columns from the table and that files has to be deleted for very 3 days starting with the name "X_" &lt;BR /&gt;&lt;BR /&gt;Can any one help about this..&lt;BR /&gt;&lt;BR /&gt;Thankingyou&lt;BR /&gt;Rajkumar&lt;BR /&gt;</description>
      <pubDate>Thu, 11 Oct 2001 06:37:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/housekeeping-scripts/m-p/2593009#M33121</guid>
      <dc:creator>Rajkumar_3</dc:creator>
      <dc:date>2001-10-11T06:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: Housekeeping Scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/housekeeping-scripts/m-p/2593010#M33122</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Please provide an example of the table.&lt;BR /&gt;&lt;BR /&gt;Rgds, Robin.</description>
      <pubDate>Thu, 11 Oct 2001 06:52:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/housekeeping-scripts/m-p/2593010#M33122</guid>
      <dc:creator>Robin Wakefield</dc:creator>
      <dc:date>2001-10-11T06:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: Housekeeping Scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/housekeeping-scripts/m-p/2593011#M33123</link>
      <description>Hai Robin,&lt;BR /&gt;&lt;BR /&gt;Thank you for your reply...&lt;BR /&gt;&lt;BR /&gt;My table structure is like this..&lt;BR /&gt;&lt;BR /&gt;create table CARD(card_id varchar2(10),&lt;BR /&gt;                           In_dir   varchar2(255),&lt;BR /&gt;                           out_dir   varchar2(255))&lt;BR /&gt;&lt;BR /&gt;In the columns "In_dir" &amp;amp;  "out_dir" users will store nearly upto 10 directory names.&lt;BR /&gt;&lt;BR /&gt;For Example: &lt;BR /&gt;---------------&lt;BR /&gt;In_dir : /test_in1/oracle&lt;BR /&gt;          : /test_in2/oracle&lt;BR /&gt;          : /test_in3/oracle......upto  /test10/oracle&lt;BR /&gt;&lt;BR /&gt;Out_dir : /test_out1/oracle&lt;BR /&gt;            : /test_out2/oracle&lt;BR /&gt;            : /test_out3/oracle......upto  /test10/oracle&lt;BR /&gt;&lt;BR /&gt;So my script has to read the paths from the directories from the 2 columns and delete the files starting with "X_" for every 3 days only....After deleting the files it has to be written to the syslog file about the status of those files whether it was successfull or not...&lt;BR /&gt;&lt;BR /&gt;Ok is it possible to read from the Database table.&lt;BR /&gt;If possible how can we select the path names from the CARD table &amp;amp; delete the files using Shell Script in HP-Unix 11.0&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks for the advance in help..&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Rajkumar</description>
      <pubDate>Thu, 11 Oct 2001 07:59:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/housekeeping-scripts/m-p/2593011#M33123</guid>
      <dc:creator>Rajkumar_3</dc:creator>
      <dc:date>2001-10-11T07:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: Housekeeping Scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/housekeeping-scripts/m-p/2593012#M33124</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Sorry, one more question.  Does this table exist as a text file, and if so, can you attach an example.  I need to know if each line only contains 3 entries, or if there are multiple directories listed per line.&lt;BR /&gt;&lt;BR /&gt;Thanks, Robin.</description>
      <pubDate>Thu, 11 Oct 2001 08:08:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/housekeeping-scripts/m-p/2593012#M33124</guid>
      <dc:creator>Robin Wakefield</dc:creator>
      <dc:date>2001-10-11T08:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: Housekeeping Scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/housekeeping-scripts/m-p/2593013#M33125</link>
      <description>Hai Robin,&lt;BR /&gt;&lt;BR /&gt;I will give the complete picture&lt;BR /&gt;If i issue the select command the output will look like this....&lt;BR /&gt;&lt;BR /&gt;SQL&amp;gt;select * from CARD;&lt;BR /&gt;card_id   In_dir                    Out_dir&lt;BR /&gt;---------  ---------                   ----------&lt;BR /&gt;1d        /test_in1/oracle      /test_out1/oracle&lt;BR /&gt;2d        /test_in1/oracle      /test_out1/oracle&lt;BR /&gt;3d        /test_in1/oracle      /test_out1/oracle&lt;BR /&gt;4d        /test_in1/oracle      /test_out1/oracle&lt;BR /&gt;5d        /test_in1/oracle      /test_out1/oracle&lt;BR /&gt;6d        /test_in1/oracle      /test_out1/oracle&lt;BR /&gt;7d        /test_in1/oracle      /test_out1/oracle&lt;BR /&gt;8d        /test_in1/oracle      /test_out1/oracle&lt;BR /&gt;9d        /test_in1/oracle      /test_out1/oracle&lt;BR /&gt;10d       /test_in1/oracle      /test_out1/oracle&lt;BR /&gt;&lt;BR /&gt;1)So the script has to pick up the directory names of    the 2 columns  from this table.&lt;BR /&gt;2)after that the shell script has to search for that    directories path from the home directory of the    system.&lt;BR /&gt;3)And it has to delete the files starting with "X_"&lt;BR /&gt;&lt;BR /&gt;Is it possible to pickup from Oracle database table??&lt;BR /&gt;&lt;BR /&gt;Thanks &amp;amp; Regards&lt;BR /&gt;Rajkumar</description>
      <pubDate>Thu, 11 Oct 2001 08:45:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/housekeeping-scripts/m-p/2593013#M33125</guid>
      <dc:creator>Rajkumar_3</dc:creator>
      <dc:date>2001-10-11T08:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: Housekeeping Scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/housekeeping-scripts/m-p/2593014#M33126</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Something like this should do what you want:&lt;BR /&gt;&lt;BR /&gt;cat tablename |grep oracle | while read cardid dir1 dir2 ; do&lt;BR /&gt;find $dir1 $dir2 -mtime +3 -name "X_*" | xargs rm&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;To check it is going to delete what you want, change the "xargs rm" to "xargs ls -ld"&lt;BR /&gt;&lt;BR /&gt;I am not familiar with Oracle, so I can't answer your last question.&lt;BR /&gt;&lt;BR /&gt;Rgds, Robin.</description>
      <pubDate>Thu, 11 Oct 2001 09:27:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/housekeeping-scripts/m-p/2593014#M33126</guid>
      <dc:creator>Robin Wakefield</dc:creator>
      <dc:date>2001-10-11T09:27:14Z</dc:date>
    </item>
    <item>
      <title>Re: Housekeeping Scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/housekeeping-scripts/m-p/2593015#M33127</link>
      <description>Rajkumar,&lt;BR /&gt;&lt;BR /&gt;there are several things that might be difficult with this structure:&lt;BR /&gt;&lt;BR /&gt;- you need to make sure, that SQLPLUS sets the CHARWIDTH to maximum, to avoid that it clips needed information&lt;BR /&gt;- you need to parse for ":" to delimit.&lt;BR /&gt;&lt;BR /&gt;if you want to stay with this structure, I would recommend to parse the SQLPLUS-output with awk, using ":" as a delimiter, but I would favor the following:&lt;BR /&gt;&lt;BR /&gt;- add a serialnumber to the key&lt;BR /&gt;- if needed add an in/out attribute field&lt;BR /&gt;- just have one directory column&lt;BR /&gt;&lt;BR /&gt;this would make a table like this:&lt;BR /&gt;&lt;BR /&gt;id, ser, type, dir&lt;BR /&gt;&lt;BR /&gt;1d, 1, 'i', /test_in1/oracle&lt;BR /&gt;1d, 2, 'i', /test_in2/oracle&lt;BR /&gt;1d, 3, 'o', /test_out1/oracle&lt;BR /&gt;&lt;BR /&gt;And now, you can do a fine selection:&lt;BR /&gt;&lt;BR /&gt;select 'rm ' || dir || '/X_*' from table where ... (whatever you want, id=, type= and so on)&lt;BR /&gt;&lt;BR /&gt;You might need to set some SQLPLUS options to get rid of headings and so, but as a result, you could spool the output and run it later.&lt;BR /&gt;&lt;BR /&gt;Hope this helps&lt;BR /&gt;Volker</description>
      <pubDate>Thu, 11 Oct 2001 09:57:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/housekeeping-scripts/m-p/2593015#M33127</guid>
      <dc:creator>Volker Borowski</dc:creator>
      <dc:date>2001-10-11T09:57:10Z</dc:date>
    </item>
    <item>
      <title>Re: Housekeeping Scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/housekeeping-scripts/m-p/2593016#M33128</link>
      <description>It is me once more :-)&lt;BR /&gt;&lt;BR /&gt;I just came across your other thread, and now I imagine, what you want to achieve.&lt;BR /&gt;&lt;BR /&gt;I would change my recomendation, and modify it the following way:&lt;BR /&gt;&lt;BR /&gt;Have an additional status column in that table, which can be tagged as "obsolete" by the application, if it has REALLY processed the file. I never like to have some time based restrictions on these type of interfaces, because some day (likely to be when some public holiday are grouped around a weekend) what intended to work will suddely do not, and maybe cause damage.&lt;BR /&gt;&lt;BR /&gt;Interfaces should work with handshakes, not with hope, that something is already processed :-)&lt;BR /&gt;&lt;BR /&gt;So if the application tags your record in this table as "yes, I processed it", your job can delete it for sure. You can then create your spooled delete script with "where status='processed'".&lt;BR /&gt;&lt;BR /&gt;Just my 0.02?&lt;BR /&gt;Volker</description>
      <pubDate>Thu, 11 Oct 2001 10:35:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/housekeeping-scripts/m-p/2593016#M33128</guid>
      <dc:creator>Volker Borowski</dc:creator>
      <dc:date>2001-10-11T10:35:58Z</dc:date>
    </item>
    <item>
      <title>Re: Housekeeping Scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/housekeeping-scripts/m-p/2593017#M33129</link>
      <description>Hi raj&lt;BR /&gt;I assumed your in_directory1 column has the name which has to be removed.&lt;BR /&gt;&lt;BR /&gt;cat &amp;gt; s.sql&lt;BR /&gt;set head off&lt;BR /&gt;set feedback off&lt;BR /&gt;spool /tmp/x&lt;BR /&gt;select in_dir from card where in_dir like '/test_in/oracle/X_%';&lt;BR /&gt;spool off&lt;BR /&gt;&lt;BR /&gt;cd /test_in/oracle&lt;BR /&gt;sed 's\/test_in\/oracle//' /tmp/x.lst&amp;gt;/tmp/x1.lst&lt;BR /&gt;for i in `cat /tmp/x1.lst`&lt;BR /&gt;do&lt;BR /&gt;rm i&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Please repeat the same for out_dir&lt;BR /&gt;&lt;BR /&gt;Regds&lt;BR /&gt;jp</description>
      <pubDate>Thu, 11 Oct 2001 12:33:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/housekeeping-scripts/m-p/2593017#M33129</guid>
      <dc:creator>Jayaprakash_1</dc:creator>
      <dc:date>2001-10-11T12:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: Housekeeping Scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/housekeeping-scripts/m-p/2593018#M33130</link>
      <description>Hai All,&lt;BR /&gt;&lt;BR /&gt;Thank you for your replies..I have tried with all your options but to some extent i have reached..but here I am not deleting any columns in the table..So i have the altenative way like this..&lt;BR /&gt;&lt;BR /&gt;Once again i am repeating my query...&lt;BR /&gt;&lt;BR /&gt;1) In the /app/sales directory i have so many files    starting with the Prefix " X_filename.extension "&lt;BR /&gt;&lt;BR /&gt;In this directory daily nearly upto 100 files will be generated using some other application...&lt;BR /&gt;&lt;BR /&gt;So now i want to clean up only those files which starts with the letter "X_" for every 3 days and the message should be written to syslog.log in the directory  /var/adm/syslog using the LOGGER command&lt;BR /&gt;&lt;BR /&gt;Now i want to write a shell script using this method..&lt;BR /&gt;&lt;BR /&gt;1) I have set an Enviromnent variable in     HP-Unix11.0  like..&lt;BR /&gt;    &lt;BR /&gt;#env_dir=/app/sales&lt;BR /&gt;&lt;BR /&gt;2) Now i want to write a shell script using the     Environment variable "env_dir" . Because in this variable i have /app/sales directory..&lt;BR /&gt;&lt;BR /&gt;3) so finally my scripts has to delete the files as said above using the variable " env_dir "..And in this directory i have so many files which starts with "X_"&lt;BR /&gt;&lt;BR /&gt;Can you please provide me a script.....&lt;BR /&gt;&lt;BR /&gt;Thanks for the advance in help..&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Rajkumar</description>
      <pubDate>Mon, 15 Oct 2001 01:58:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/housekeeping-scripts/m-p/2593018#M33130</guid>
      <dc:creator>Rajkumar_3</dc:creator>
      <dc:date>2001-10-15T01:58:47Z</dc:date>
    </item>
  </channel>
</rss>

