<?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 help needed in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-needed/m-p/4407469#M682017</link>
    <description>Hi All,&lt;BR /&gt;I have a file which is actually an ls -lrt o/p of a particular directory like.&lt;BR /&gt;------------------&lt;BR /&gt;-rw-r--r--   1 501        206             13 Mar  6 07:01 /var/archive/prodcomp/batchlog/tmpwrk_EXZPR00Bs.06rwc.03060702/tmpwrk_EXZPR00Bs.06rwc/startup_parms&lt;BR /&gt;146107 -rw-r--r--   1 501        206              6 Mar  6 07:02 /var/archive/prodcomp/batchlog/tmpwrk_EXZPR00Bs.06rwc.03060702/tmpwrk_EXZPR00Bs.06rwc/runphase&lt;BR /&gt;146120 -rw-r--r--   1 501        206            167 Mar  6 07:01 /var/archive/prodcomp/batchlog/tmpwrk_EXZPR00Bs.06rwc.03060702/tmpwrk_EXZPR00Bs.06rwc/parfile&lt;BR /&gt;146202 -rw-r--r--   1 501        206              6 Mar  6 07:02 /var/archive/prodcomp/batchlog/tmpwrk_EXZPR00Bs.06rwc.03060702/tmpwrk_EXZPR00Bs.06rwc/smd_jobid&lt;BR /&gt;-----------------&lt;BR /&gt;I just want to know how to find out how many files are getting created on each and every day in the particular directory.&lt;BR /&gt;&lt;BR /&gt;thanks for the answers&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Dev</description>
    <pubDate>Fri, 24 Apr 2009 11:24:20 GMT</pubDate>
    <dc:creator>kumardev</dc:creator>
    <dc:date>2009-04-24T11:24:20Z</dc:date>
    <item>
      <title>Script help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-needed/m-p/4407469#M682017</link>
      <description>Hi All,&lt;BR /&gt;I have a file which is actually an ls -lrt o/p of a particular directory like.&lt;BR /&gt;------------------&lt;BR /&gt;-rw-r--r--   1 501        206             13 Mar  6 07:01 /var/archive/prodcomp/batchlog/tmpwrk_EXZPR00Bs.06rwc.03060702/tmpwrk_EXZPR00Bs.06rwc/startup_parms&lt;BR /&gt;146107 -rw-r--r--   1 501        206              6 Mar  6 07:02 /var/archive/prodcomp/batchlog/tmpwrk_EXZPR00Bs.06rwc.03060702/tmpwrk_EXZPR00Bs.06rwc/runphase&lt;BR /&gt;146120 -rw-r--r--   1 501        206            167 Mar  6 07:01 /var/archive/prodcomp/batchlog/tmpwrk_EXZPR00Bs.06rwc.03060702/tmpwrk_EXZPR00Bs.06rwc/parfile&lt;BR /&gt;146202 -rw-r--r--   1 501        206              6 Mar  6 07:02 /var/archive/prodcomp/batchlog/tmpwrk_EXZPR00Bs.06rwc.03060702/tmpwrk_EXZPR00Bs.06rwc/smd_jobid&lt;BR /&gt;-----------------&lt;BR /&gt;I just want to know how to find out how many files are getting created on each and every day in the particular directory.&lt;BR /&gt;&lt;BR /&gt;thanks for the answers&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Dev</description>
      <pubDate>Fri, 24 Apr 2009 11:24:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-needed/m-p/4407469#M682017</guid>
      <dc:creator>kumardev</dc:creator>
      <dc:date>2009-04-24T11:24:20Z</dc:date>
    </item>
    <item>
      <title>Re: Script help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-needed/m-p/4407470#M682018</link>
      <description>Shalom,&lt;BR /&gt;&lt;BR /&gt;Best to run with cron once a day.&lt;BR /&gt;&lt;BR /&gt;cd &lt;DIRECTORYNAME&gt; &lt;BR /&gt;ls -1 | wc -l | mailx -s "daily file number report" &lt;EMAIL address=""&gt;&lt;BR /&gt;&lt;BR /&gt;Run it the next day and do the math.&lt;BR /&gt;&lt;BR /&gt;You can get more elaborate if you wish, but that is the basis.&lt;BR /&gt;&lt;BR /&gt;SEP&lt;/EMAIL&gt;&lt;/DIRECTORYNAME&gt;</description>
      <pubDate>Fri, 24 Apr 2009 11:47:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-needed/m-p/4407470#M682018</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2009-04-24T11:47:58Z</dc:date>
    </item>
    <item>
      <title>Re: Script help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-needed/m-p/4407471#M682019</link>
      <description>&lt;!--!*#--&gt;Hi:&lt;BR /&gt;&lt;BR /&gt;# cat ./tally&lt;BR /&gt;#!/usr/bin/perl&lt;BR /&gt;use strict;&lt;BR /&gt;use warnings;&lt;BR /&gt;my (@F, %day);&lt;BR /&gt;while (&amp;lt;&amp;gt;) {&lt;BR /&gt;    next unless /^(-|d|l)/;&lt;BR /&gt;    @F = split;&lt;BR /&gt;    $day{sprintf "%3s %02d", $F[5], $F[6]}++&lt;BR /&gt;}&lt;BR /&gt;for (sort keys %day) {&lt;BR /&gt;    print $_, ' = ', $day{$_}, "\n";&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;Run as:&lt;BR /&gt;&lt;BR /&gt;# ./tally file&lt;BR /&gt;&lt;BR /&gt;...or:&lt;BR /&gt;&lt;BR /&gt;# ls -l /path | ./tally&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 24 Apr 2009 11:51:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-needed/m-p/4407471#M682019</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-04-24T11:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: Script help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-needed/m-p/4407472#M682020</link>
      <description>acually i have run the command :-&lt;BR /&gt;find /var/archive/prodcomp/batchlog ! -type d -exec ls -lrt -print {} \; &amp;gt; /home/xosdj001/files&lt;BR /&gt;&lt;BR /&gt;for getting the o/p in the files, now in the same file I want to know for each and every day how may files and are getting created(count) and what is the total size of within one day is getting generated.Which sud give me an o/p like:-&lt;BR /&gt;=============&lt;BR /&gt;Day     Files_Generated Tot_siz_files        &lt;BR /&gt;May 6      20               300 MB&lt;BR /&gt;May 7      15               250 MB&lt;BR /&gt;May 8       9               75 MB&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;&lt;BR /&gt;============= &lt;BR /&gt;&lt;BR /&gt;Thanks again&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Dev</description>
      <pubDate>Fri, 24 Apr 2009 12:01:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-needed/m-p/4407472#M682020</guid>
      <dc:creator>kumardev</dc:creator>
      <dc:date>2009-04-24T12:01:12Z</dc:date>
    </item>
    <item>
      <title>Re: Script help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-needed/m-p/4407473#M682021</link>
      <description>Hi Dev&lt;BR /&gt;&lt;BR /&gt;Add this script to your crontab to run daily and this script keeps updated copy of filesizes in bytes - convert to MB if you need by modifying the script.&lt;BR /&gt;&lt;BR /&gt;echo "==============================================" &amp;gt; /tmp/file_list&lt;BR /&gt;echo "Day \t Files_Generated \t Tot_siz_files " &amp;gt;&amp;gt; /tmp/file_list&lt;BR /&gt;echo "==============================================" &amp;gt;&amp;gt; /tmp/file_list&lt;BR /&gt;for i in `ls -lrt /home/xosdj001/files  | awk '{print $6}'| uniq`&lt;BR /&gt;do&lt;BR /&gt;for j in `ls -lrt /home/xosdj001/files  |  grep $i | awk '{print $7}'| uniq`&lt;BR /&gt;do&lt;BR /&gt;SUM=`ls -lrt /home/xosdj001/files  | grep "$i" |awk '{sum = sum + $5} END {print sum}'`&lt;BR /&gt;NO=`ls -lrt /home/xosdj001/files  | grep "$i" | wc -l`&lt;BR /&gt;echo "$i $j \t $NO \t\t $SUM" &amp;gt;&amp;gt; /tmp/file_list&lt;BR /&gt;done&lt;BR /&gt;done&lt;BR /&gt;echo "==============================================" &amp;gt;&amp;gt; /tmp/file_list&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Cheers !!&lt;BR /&gt;&lt;BR /&gt;Vinod&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 24 Apr 2009 12:58:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-needed/m-p/4407473#M682021</guid>
      <dc:creator>vinod_25</dc:creator>
      <dc:date>2009-04-24T12:58:34Z</dc:date>
    </item>
    <item>
      <title>Re: Script help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-needed/m-p/4407474#M682022</link>
      <description>Output looks like this&lt;BR /&gt;&lt;BR /&gt;# cat /tmp/file_list&lt;BR /&gt;==============================================&lt;BR /&gt;Day      Files_Generated         Tot_siz_files&lt;BR /&gt;==============================================&lt;BR /&gt;Mar 17          1                256&lt;BR /&gt;Apr 23         45                536421&lt;BR /&gt;Apr 24         45                536449&lt;BR /&gt;==============================================&lt;BR /&gt;</description>
      <pubDate>Fri, 24 Apr 2009 13:04:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-needed/m-p/4407474#M682022</guid>
      <dc:creator>vinod_25</dc:creator>
      <dc:date>2009-04-24T13:04:21Z</dc:date>
    </item>
    <item>
      <title>Re: Script help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-needed/m-p/4407475#M682023</link>
      <description>&lt;!--!*#--&gt;Hi (again) Dev:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; I want to know for each and every day how may files and are getting created(count) and what is the total size of within one day is getting generated.&lt;BR /&gt;&lt;BR /&gt;You _really_ should ask what you _really_ want at the onset.  Use:&lt;BR /&gt;&lt;BR /&gt;# cat ./tally&lt;BR /&gt;#!/usr/bin/perl&lt;BR /&gt;use strict;&lt;BR /&gt;use warnings;&lt;BR /&gt;my ( @F, $n, $sz, $key, %day );&lt;BR /&gt;while (&amp;lt;&amp;gt;) {&lt;BR /&gt;    next unless /^(-|d|l)/;&lt;BR /&gt;    @F   = split;&lt;BR /&gt;    $key = sprintf "%3s %02d", $F[5], $F[6];&lt;BR /&gt;    $n   = $sz = 0;&lt;BR /&gt;    if ( exists $day{$key} ) {&lt;BR /&gt;        $n  = $day{$key}[0];&lt;BR /&gt;        $sz = $day{$key}[1];&lt;BR /&gt;    }&lt;BR /&gt;    $n++;&lt;BR /&gt;    $sz += $F[4];&lt;BR /&gt;    $day{$key} = [ $n, $sz ];&lt;BR /&gt;}&lt;BR /&gt;for $key ( sort keys %day ) {&lt;BR /&gt;    print $key, ' = ', $day{$key}[0], " -&amp;gt; ", $day{$key}[1], "\n";&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;...run as:&lt;BR /&gt;&lt;BR /&gt;# ./tally file&lt;BR /&gt;&lt;BR /&gt;Your output will look like:&lt;BR /&gt;&lt;BR /&gt;Apr 01 = 5 -&amp;gt; 1387253&lt;BR /&gt;Apr 16 = 1 -&amp;gt; 100&lt;BR /&gt;Apr 17 = 1 -&amp;gt; 1024&lt;BR /&gt;Apr 19 = 2 -&amp;gt; 8218&lt;BR /&gt;Apr 23 = 3 -&amp;gt; 2964&lt;BR /&gt;Apr 24 = 1 -&amp;gt; 51366&lt;BR /&gt;Apr 29 = 1 -&amp;gt; 590&lt;BR /&gt;Aug 17 = 2 -&amp;gt; 2458&lt;BR /&gt;Feb 02 = 1 -&amp;gt; 104&lt;BR /&gt;Feb 14 = 2 -&amp;gt; 102792&lt;BR /&gt;Feb 17 = 1 -&amp;gt; 8192&lt;BR /&gt;Feb 23 = 1 -&amp;gt; 8192&lt;BR /&gt;Feb 29 = 1 -&amp;gt; 738&lt;BR /&gt;Jul 17 = 1 -&amp;gt; 266&lt;BR /&gt;Jul 29 = 1 -&amp;gt; 8192&lt;BR /&gt;Jun 29 = 2 -&amp;gt; 192&lt;BR /&gt;Mar 11 = 3 -&amp;gt; 1372132&lt;BR /&gt;Nov 11 = 2 -&amp;gt; 7651&lt;BR /&gt;Nov 14 = 1 -&amp;gt; 965&lt;BR /&gt;Oct 10 = 2 -&amp;gt; 290749&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 24 Apr 2009 13:25:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-needed/m-p/4407475#M682023</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-04-24T13:25:46Z</dc:date>
    </item>
    <item>
      <title>Re: Script help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-needed/m-p/4407476#M682024</link>
      <description>&lt;!--!*#--&gt;Hi:&lt;BR /&gt;&lt;BR /&gt;This version makes the formatting changes including the output in MB you wanted:&lt;BR /&gt;&lt;BR /&gt;# cat ./tally&lt;BR /&gt;#!/usr/bin/perl&lt;BR /&gt;use strict;&lt;BR /&gt;use warnings;&lt;BR /&gt;my (@F, $n, $sz, $key, %day);&lt;BR /&gt;while (&amp;lt;&amp;gt;) {&lt;BR /&gt;    next unless /^(-|d|l)/;&lt;BR /&gt;    @F = split;&lt;BR /&gt;    $key = sprintf "%3s %02d", $F[5], $F[6];&lt;BR /&gt;    $n = $sz = 0;&lt;BR /&gt;    if ( exists $day{$key} ) {&lt;BR /&gt;        $n  = $day{$key}[0];&lt;BR /&gt;        $sz = $day{$key}[1];&lt;BR /&gt;    }&lt;BR /&gt;    $n++;&lt;BR /&gt;    $sz+=$F[4];&lt;BR /&gt;    $day{$key} = [ $n, $sz ];&lt;BR /&gt;}&lt;BR /&gt;print "Day    #Files Total_Size\n------ ------ ----------\n";&lt;BR /&gt;for $key (sort keys %day) {&lt;BR /&gt;    printf "%s %6d %7.0f MB\n" ,$key, $day{$key}[0], $day{$key}[1]/1024/1024;&lt;BR /&gt;}&lt;BR /&gt;1;&lt;BR /&gt;&lt;BR /&gt;# cat ./tally&lt;BR /&gt;&lt;BR /&gt;Your output will look like:&lt;BR /&gt;&lt;BR /&gt;Day    #Files Total_Size&lt;BR /&gt;------ ------ ----------&lt;BR /&gt;Apr 16      8       0 MB&lt;BR /&gt;Apr 17      6     103 MB&lt;BR /&gt;Apr 18      3      53 MB&lt;BR /&gt;Apr 19      6     148 MB&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 25 Apr 2009 17:49:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-needed/m-p/4407476#M682024</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-04-25T17:49:16Z</dc:date>
    </item>
  </channel>
</rss>

