home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 2 / 2887 < prev    next >
Internet Message Format  |  1991-02-28  |  19KB

  1. From: jv@mh.nl (Johan Vromans)
  2. Newsgroups: comp.lang.perl,alt.sources
  3. Subject: dusage.pl (Was: Re: monitoring disk usage...)
  4. Message-ID: <1991Feb28.104805.24928@pronto.mh.nl>
  5. Date: 28 Feb 91 10:48:05 GMT
  6.  
  7. In article <4bmMK9O00j6949bmNF@andrew.cmu.edu> jb3o+@andrew.cmu.edu (Jon Allen Boone) writes:
  8.  
  9.    Not having recieved my copy of Programming perl yet, can anyone send me
  10.    a program which will find the free space on mounted volumes (via df?),
  11.    sort them (so that the output is the same regardless of machine run
  12.    from), compare the free space left with the amount last reported (from
  13.    the end of a file), return the percentage change (up or down) in disk
  14.    usage for individual file systems, percentage change (up or down) in
  15.    total disk usage, and report the raw amount (stdout & append to file
  16.    mentioned earlier).
  17.  
  18. Reposting time ... (actually, this is an updated version).
  19.  
  20. Submitted-by: jv@mh.nl
  21. Archive-name: dusage/part01
  22.  
  23. ---- Cut Here and feed the following to sh ----
  24. #!/bin/sh
  25. # This is dusage, a shell archive (produced by shar 3.49)
  26. # To extract the files from this archive, save it to a file, remove
  27. # everything above the "!/bin/sh" line above, and type "sh file_name".
  28. #
  29. # made 02/28/1991 10:46 UTC by jv@largo.mh.nl
  30. # Source directory /u1/users/jv/src/dusage
  31. #
  32. # existing files WILL be overwritten
  33. #
  34. # This shar contains:
  35. # length  mode       name
  36. # ------ ---------- ------------------------------------------
  37. #    278 -rw-r--r-- Makefile
  38. #  10109 -r--r--r-- dusage.pl
  39. #   5139 -r--r--r-- dusage.1
  40. #    397 -rw-r--r-- dusage.ctl
  41. #
  42. # ============= Makefile ==============
  43. echo 'x - extracting Makefile (Text)'
  44. sed 's/^X//' << 'SHAR_EOF' > 'Makefile' &&
  45. SHELL    = /bin/sh
  46. SRC    = Makefile dusage.pl dusage.1 dusage.ctl
  47. X
  48. dusage:    dusage.ctl
  49. X    cp dusage.pl dusage
  50. X    chmod 0755 dusage
  51. X
  52. install:    dusage
  53. X    install -c -m 0755 dusage /usr/local/bin/dusage
  54. X
  55. DOMAIN    = .mh.nl
  56. shar:
  57. X    shar -acxf -ndusage -sjv@`hostname`$(DOMAIN) -o dusage.shar $(SRC)
  58. SHAR_EOF
  59. chmod 0644 Makefile ||
  60. echo 'restore of Makefile failed'
  61. Wc_c="`wc -c < 'Makefile'`"
  62. test 278 -eq "$Wc_c" ||
  63.     echo 'Makefile: original size 278, current size' "$Wc_c"
  64. # ============= dusage.pl ==============
  65. echo 'x - extracting dusage.pl (Text)'
  66. sed 's/^X//' << 'SHAR_EOF' > 'dusage.pl' &&
  67. #!/usr/bin/perl
  68. #
  69. # dusage.pl -- gather disk usage statistics
  70. # SCCS Status     : @(#)@ dusage    1.9
  71. # Author          : Johan Vromans
  72. # Created On      : Sun Jul  1 21:49:37 1990
  73. # Last Modified By: Johan Vromans
  74. # Last Modified On: Tue Feb 19 16:41:23 1991
  75. # Update Count    : 3
  76. # Status          : OK
  77. #
  78. # This program requires perl version 3.0, patchlevel 12 or higher.
  79. #
  80. # Copyright 1990,1991 Johan Vromans, all rights reserved.
  81. # This program may be used, modified and distributed as long as
  82. # this copyright notice remains part of the source. It may not be sold, or 
  83. # be used to harm any living creature including the world and the universe.
  84. X
  85. $my_name = $0;
  86. X
  87. ################ usage ################
  88. X
  89. sub usage {
  90. X  local ($help) = shift (@_);
  91. X  local ($usg) = "usage: $my_name [-afghruD][-i input][-p dir] ctlfile";
  92. X  die "$usg\nstopped" unless $help;
  93. X  print STDERR "$usg\n";
  94. X  print STDERR <<EndOfHelp
  95. X
  96. X    -D          - provide debugging info
  97. X    -a          - provide all statis
  98. X    -f          - also report file statistics
  99. X    -g          - gather new data
  100. X    -h          - this help message
  101. X    -i input    - input data as obtained by 'du dir' [def = 'du dir']
  102. X    -p dir      - path to which files in the control file are relative
  103. X    -r          - do not discard entries which don't have data
  104. X    -u          - update the control file with new values
  105. X    ctlfile     - file which controls which dirs to report [def = dir/.du.ctl]
  106. EndOfHelp
  107. X  ;
  108. X  exit 1;
  109. }
  110. X
  111. ################ main stream ################
  112. X
  113. &do_get_options;        # process options
  114. &do_parse_ctl;            # read the control file
  115. &do_gather if $gather;        # gather new info
  116. &do_report_and_update;        # report and update
  117. X
  118. ################ end of main stream ################
  119. X
  120. ################ other subroutines ################
  121. X
  122. sub do_get_options {
  123. X
  124. X  # Default values for options
  125. X
  126. X  $debug = 0;
  127. X  $noupdate = 1;
  128. X  $retain = 0;
  129. X  $gather = 0;
  130. X  $allfiles = 0;
  131. X  $allstats = 0;
  132. X
  133. X  # Command line options. We use a modified version of getopts.pl.
  134. X
  135. X  do "getopts.pl" || die "Cannot load getopts.pl, stopped";
  136. X  die $@ if $@;
  137. X
  138. X  &usage (0) if !&Getopts ("Dafghi:p:ru");
  139. X  &usage (1) if $opt_h;
  140. X  &usage (0) if $#ARGV > 0;
  141. X
  142. X  $debug    |= $opt_D if defined $opt_D;    # -D -> debug
  143. X  $allstats |= $opt_a if defined $opt_a;    # -a -> all stats
  144. X  $allfiles |= $opt_f if defined $opt_f;    # -f -> report all files
  145. X  $gather   |= $opt_g if defined $opt_g;    # -g -> gather new data
  146. X  $retain   |= $opt_r if defined $opt_r;    # -r -> retain old entries
  147. X  $noupdate = !$opt_u if defined $opt_u;    # -u -> update the control file
  148. X  $du        = $opt_i if defined $opt_i;    # -i input file
  149. X  if ( defined $opt_p ) {            # -p path
  150. X    $root = $opt_p;
  151. X    $root = $` while ($root =~ m|/$|);
  152. X    $prefix = "$root/";
  153. X    $root = "/" if $root eq "";
  154. X  }
  155. X  else {
  156. X    $prefix = $root = "";
  157. X  }
  158. X  $table    = ($#ARGV == 0) ? shift (@ARGV) : "$prefix.du.ctl";
  159. X  $runtype = $allfiles ? "file" : "directory";
  160. X  if ($debug) {
  161. X    print STDERR "@(#)@ dusage    1.9 - dusage.pl\n";
  162. X    print STDERR "Options:";
  163. X    print STDERR " debug" if $debug;    # silly, isn't it...
  164. X    print STDERR $noupdate ? " no" : " ", "update";
  165. X    print STDERR $retain ? " " : " no", "retain";
  166. X    print STDERR $gather ? " " : " no", "gather";
  167. X    print STDERR $allstats ? " " : " no", "allstats";
  168. X    print STDERR "\n";
  169. X    print STDERR "Root = $root [prefix = $prefix]\n";
  170. X    print STDERR "Control file = $table\n";
  171. X    print STDERR "Input data = $du\n" if defined $du;
  172. X    print STDERR "Run type = $runtype\n";
  173. X    print STDERR "\n";
  174. X  }
  175. }
  176. X
  177. sub do_parse_ctl {
  178. X
  179. X  # Parsing the control file.
  180. X  #
  181. X  # This file contains the names of the (sub)directories to tally,
  182. X  # and the values dereived from previous runs.
  183. X  # The names of the directories are relative to the $root.
  184. X  # The name may contain '*' or '?' characters, and will be globbed if so.
  185. X  # An entry starting with ! is excluded.
  186. X  #
  187. X  # To add a new dir, just add the name. The special name '.' may 
  188. X  # be used to denote the $root directory. If used, '-p' must be
  189. X  # specified.
  190. X  #
  191. X  # Upon completion:
  192. X  #  - %oldblocks is filled with the previous values,
  193. X  #    colon separated, for each directory.
  194. X  #  - @targets contains a list of names to be looked for. These include
  195. X  #    break indications and globs info, which will be stripped from
  196. X  #    the actual search list.
  197. X
  198. X  open (tb, "<$table") || die "Cannot open control file $table, stopped";
  199. X  @targets = ();
  200. X  %oldblocks = ();
  201. X  %newblocks = ();
  202. X
  203. X  while ($tb = <tb>) {
  204. X    chop ($tb);
  205. X
  206. X    # preferred syntax: <dir><TAB><size>:<size>:....
  207. X    # allowable          <dir><TAB><size> <size> ...
  208. X    # possible          <dir>
  209. X
  210. X    if ( $tb =~ /^-/ ) {    # break
  211. X      push (@targets, "$tb");
  212. X      printf STDERR "tb: *break* $tb\n" if $debug;
  213. X      next;
  214. X    }
  215. X
  216. X    if ( $tb =~ /^!/ ) {    # exclude
  217. X      $excl = $';        #';
  218. X      @a = grep ($_ ne $excl, @targets);
  219. X      @targets = @a;
  220. X      push (@targets, "*$tb");
  221. X      printf STDERR "tb: *excl* $tb\n" if $debug;
  222. X      next;
  223. X    }
  224. X
  225. X    if ($tb =~ /^(.+)\t([\d: ]+)/) {
  226. X      $name = $1;
  227. X      @blocks = split (/[ :]/, $2);
  228. X    }
  229. X    else {
  230. X      $name = $tb;
  231. X      @blocks = ("","","","","","","","");
  232. X    }
  233. X
  234. X    if ($name eq ".") {
  235. X      if ( $root eq "" ) {
  236. X    printf STDERR "Warning: \".\" in control file w/o \"-p path\" - ignored\n";
  237. X    next;
  238. X      }
  239. X      $name = $root;
  240. X    } else {
  241. X      $name = $prefix . $name unless ord($name) == ord ("/");
  242. X    }
  243. X
  244. X    # Check for globs ...
  245. X    if ( $gather && $name =~ /\*|\?/ ) {
  246. X      print STDERR "glob: $name\n" if $debug;
  247. X      foreach $n ( <${name}> ) {
  248. X    next unless $allfiles || -d $n;
  249. X    # Globs never overwrite existing entries
  250. X    if ( !defined $oldblocks{$n} ) {
  251. X      $oldblocks{$n} = ":::::::";
  252. X      push (@targets, $n);
  253. X    }
  254. X    printf STDERR "glob: -> $n\n" if $debug;
  255. X      }
  256. X      # Put on the globs list, and terminate this entry
  257. X      push (@targets, "*$name");
  258. X      next;
  259. X    }
  260. X
  261. X    push (@targets, "$name");
  262. X    # Entry may be rewritten (in case of globs)
  263. X    $oldblocks{$name} = join (":", @blocks[0..7]);
  264. X
  265. X    print STDERR "tb: $name\t$oldblocks{$name}\n" if $debug;
  266. X  }
  267. X  close (tb);
  268. }
  269. X
  270. sub do_gather {
  271. X
  272. X  # Build a targets match string, and an optimized list of directories to
  273. X  # search.
  274. X  $targets = "//";
  275. X  @list = ();
  276. X  $last = "///";
  277. X  foreach $name (sort (@targets)) {
  278. X    next if $name =~ /^[-*]/;
  279. X    next unless $allfiles || -d $name;
  280. X    $targets .= "$name//"; 
  281. X    next if ($name =~ m|^$last/|);
  282. X    push (@list, $name);
  283. X    ($last = $name) =~ s/(\W)/\\$1/g; # protect regexp chars in dir names
  284. X  }
  285. X
  286. X  print STDERR "targets: $targets\n" if $debug;
  287. X  print STDERR "list: @list\n" if $debug;
  288. X  print STDERR "reports: @targets\n" if $debug;
  289. X
  290. X  $du = "du " . ($allfiles ? "-a" : "") . " @list|"
  291. X    unless defined $du; # in which case we have a data file
  292. X
  293. X  # Process the data. If a name is found in the target list, 
  294. X  # %newblocks will be set to the new blocks value.
  295. X
  296. X  open (du, "$du") || die "Cannot get data from $du, stopped";
  297. X  while ($du = <du>) {
  298. X    chop ($du);
  299. X    ($blocks,$name) = split (/\t/, $du);
  300. X    if (($i = index ($targets, "//$name//")) >= 0) {
  301. X      # tally and remove entry from search list
  302. X      $newblocks{$name} = $blocks;
  303. X      print STDERR "du: $name $blocks\n" if $debug;
  304. X      substr ($targets, $i, length($name) + 2) = "";
  305. X    }
  306. X  }
  307. X  close (du);
  308. }
  309. X
  310. X
  311. # Report generation
  312. X
  313. format std_hdr =
  314. Disk usage statistics@<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<
  315. $subtitle, $date
  316. X
  317. X blocks    +day     +week  @<<<<<<<<<<<<<<<
  318. $runtype
  319. -------  -------  -------  --------------------------------
  320. .
  321. format std_out =
  322. @>>>>>> @>>>>>>> @>>>>>>>  ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<..
  323. $blocks, $d_day, $d_week, $name
  324. .
  325. X
  326. format all_hdr =
  327. Disk usage statistics@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<           @<<<<<<<<<<<<<<<
  328. $subtitle, $date
  329. X
  330. X --0--    --1--    --2--    --3--    --4--    --5--    --6--    --7--   @<<<<<<<<<<<<<<<
  331. $runtype
  332. -------  -------  -------  -------  -------  -------  -------  -------  --------------------------------
  333. .
  334. format all_out =
  335. @>>>>>> @>>>>>>> @>>>>>>> @>>>>>>> @>>>>>>> @>>>>>>> @>>>>>>> @>>>>>>>  ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<..
  336. $a[0],  $a[1],   $a[2],   $a[3],   $a[4],   $a[5],   $a[6],   $a[7],    $name
  337. .
  338. X
  339. sub do_report_and_update {
  340. X
  341. X  # Prepare update of the control file
  342. X  if ( !$noupdate ) {
  343. X    if ( !open (tb, ">$table") ) {
  344. X      print STDERR "Warning: cannot update control file $table - continuing\n";
  345. X      $noupdate = 1;
  346. X    }
  347. X  }
  348. X
  349. X  if ( $allstats ) {
  350. X    $^ = "all_hdr";
  351. X    $~ = "all_out";
  352. X  }
  353. X  else {
  354. X    $^ = "std_hdr";
  355. X    $~ = "std_out";
  356. X  }
  357. X  $date = `date`;
  358. X  chop ($date);
  359. X
  360. X  # In one pass the report is generated, and the control file rewritten.
  361. X
  362. X  foreach $name (@targets) {
  363. X    if ($name =~ /^-/ ) {
  364. X      $subtitle = $';                #';
  365. X      print tb "$name\n" unless $noupdate;
  366. X      print STDERR "tb: $name\n" if $debug;
  367. X      $- = -1;
  368. X      next;
  369. X    }
  370. X    if ($name  =~ /^\*$prefix/ ) {
  371. X      print tb "$'\n" unless $noupdate;        #';
  372. X      print STDERR "tb: $'\n" if $debug;    #';
  373. X      next;
  374. X    }
  375. X    @a = split (/:/, $oldblocks{$name});
  376. X    unshift (@a, $newblocks{$name}) if $gather;
  377. X    $name = "." if $name eq $root;
  378. X    $name = $' if $name =~ /^$prefix/;        #';
  379. X    print STDERR "Warning: ", 1+$#a, " entries for $name\n"
  380. X      if ($debug && $#a != 8);
  381. X
  382. X    # check for valid data
  383. X    $try = join(":",@a[0..7]);
  384. X    if ( $try eq ":::::::") {
  385. X      if ($retain) {
  386. X    @a = ("","","","","","","","");
  387. X      }
  388. X      else {
  389. X    # Discard
  390. X    print STDERR "--: $name\n" if $debug;
  391. X    next;
  392. X      }
  393. X    }
  394. X
  395. X    $line = "$name\t$try\n";
  396. X    print tb $line unless $noupdate;
  397. X    print STDERR "tb: $line" if $debug;
  398. X
  399. X    $blocks = $a[0];
  400. X    if ( !$allstats ) {
  401. X      $d_day = $d_week = "";
  402. X      if ($blocks ne "") {
  403. X    if ($a[1] ne "") {        # dayly delta
  404. X      $d_day = $blocks - $a[1];
  405. X      $d_day = "+" . $d_day if $d_day > 0;
  406. X    }
  407. X    if ($a[7] ne "") {        # weekly delta
  408. X      $d_week = $blocks - $a[7];
  409. X      $d_week = "+" . $d_week if $d_week > 0;
  410. X    }
  411. X      }
  412. X    }
  413. X    write;
  414. X  }
  415. X
  416. X  # Close control file, if opened
  417. X  close (tb) unless $noupdate;
  418. }
  419. X
  420. # Emacs support
  421. # Local Variables:
  422. # mode:perl
  423. # eval:(headers)
  424. # End:
  425. SHAR_EOF
  426. chmod 0444 dusage.pl ||
  427. echo 'restore of dusage.pl failed'
  428. Wc_c="`wc -c < 'dusage.pl'`"
  429. test 10109 -eq "$Wc_c" ||
  430.     echo 'dusage.pl: original size 10109, current size' "$Wc_c"
  431. # ============= dusage.1 ==============
  432. echo 'x - extracting dusage.1 (Text)'
  433. sed 's/^X//' << 'SHAR_EOF' > 'dusage.1' &&
  434. .TH DUSAGE 1
  435. .SH NAME
  436. dusage \- provide disk usage statistics
  437. .SH SYNOPSIS
  438. .B dusage
  439. .RB [ \-afghruD ]
  440. .RI "[\fB\-i\fR" " input" ]
  441. .RI "[\fB\-p\fR" " dir" ]
  442. .RI [ "control file" ]
  443. .SH DESCRIPTION
  444. .I Dusage
  445. is a perl script which produces disk usage statistics. These
  446. statistics include the number of blocks, the increment since the previous run
  447. (which is assumed to be yesterday if run daily), and the increment
  448. since 7 runs ago (which could be interpreted as a week if run daily).
  449. .I Dusage
  450. is driven by a 
  451. .IR "control file" ,
  452. which describes the names of the files (directories) to be reported,
  453. and which also contains the results of previous runs.
  454. .PP
  455. When
  456. .I dusage
  457. is run, it reads the
  458. .IR "control file" ,
  459. [optionally] gathers new disk usage values by calling
  460. .IR du (1),
  461. prints the report, and [optionally] updates the
  462. .I control file
  463. with the new information.
  464. .PP
  465. Filenames in the control file may have wildcards. In this case, the
  466. wildcards are expanded, and all entries reported. Both the expanded
  467. names as the wildcard info are maintained in the control file. New
  468. files in these directories will automatically show up, deleted files
  469. will disappear when they have run out of data in the control file (but
  470. see the 
  471. .B \-r
  472. option).
  473. .br
  474. Wildcard expansion only adds filenames which are not already on the list.
  475. .PP
  476. The control file may also contain filenames preceded with an
  477. exclamation mark ``!''; these entries are skipped. This is meaningful
  478. in conjunction with wildcards, to exclude entries which result from a
  479. wildcard expansion.
  480. .PP
  481. The control file may have lines starting with a dash ``\-'',
  482. which causes the report to start on a new page. Any text following the
  483. dash is placed in the page header, immediately following the text
  484. ``Disk usage statistics''.
  485. .PP
  486. The available command line options are:
  487. .TP 5
  488. .B \-D
  489. Turns on debugging, which yields lots of trace information.
  490. .TP
  491. .B \-a
  492. Reports the statistics for this and all previous runs, as opposed to
  493. the normal case, which is to generate the statistics for this run, and
  494. the differences between the previous and 7th previous run.
  495. .TP
  496. .B \-f
  497. Reports file statistics also. Default is to only report directories.
  498. .TP
  499. .B \-g
  500. Gathers new data by calling 
  501. .IR du (1).
  502. .TP
  503. .B \-h
  504. Provides a help message. No work is done.
  505. .TP
  506. .BI \-i " input"
  507. Uses
  508. .I input
  509. as data obtained by calling
  510. .IR du (1).
  511. .TP
  512. .BI \-p " dir"
  513. All filenames in the control file are interpreted relative to this
  514. directory.
  515. .TP
  516. .B \-r
  517. Retains entries which don't have any data anymore. If this option is
  518. not used, entries without data are not reported, and removed from the
  519. control file.
  520. .TP
  521. .B \-u
  522. Update the control file with new values.
  523. .PP
  524. The default name for the control file is
  525. .BR .du.ctl ,
  526. optionally preceded by the name supplied with the
  527. .B \-p
  528. option.
  529. .SH EXAMPLES
  530. Given the following control file:
  531. .sp
  532. .nf
  533. .ne 3
  534. .in +.5i
  535. \- for manual page
  536. maildir
  537. maildir/*
  538. !maildir/unimportant
  539. src
  540. .in
  541. .fi
  542. .sp
  543. This will generate the following (example) report when running the
  544. command ``dusage -gu controlfile'':
  545. .sp
  546. .nf
  547. .ne 7
  548. .in +.5i
  549. Disk usage statistics for manual page      Wed Jan 10 13:38
  550. X
  551. X blocks    +day     +week  directory
  552. -------  -------  -------  --------------------------------
  553. X   6518                    maildir
  554. X      2                    maildir/dirent
  555. X    498                    src
  556. .in
  557. .fi
  558. .sp
  559. After updating the control file, it will contain:
  560. .sp
  561. .nf
  562. .ne 4
  563. .in +.5i
  564. \- for manual page
  565. maildir 6518::::::
  566. maildir/dirent  2::::::
  567. maildir/*
  568. !maildir/unimportant
  569. src     498::::::
  570. .in
  571. .fi
  572. .sp
  573. The names in the control file are separated by the values with a TAB;
  574. the values are separated with colons. Also, the entries found by
  575. expanding the wildcard are added. If the wildcard expansion had
  576. generated a name ``maildir/unimportant'' it would have been skipped.
  577. .br
  578. When the program is rerun after one day, it could print the following
  579. report:
  580. .sp
  581. .nf
  582. .ne 7
  583. .in +.5i
  584. Disk usage statistics for manual page      Wed Jan 10 13:38
  585. X
  586. X blocks    +day     +week  directory
  587. -------  -------  -------  --------------------------------
  588. X   6524       +6           maildir
  589. X      2        0           maildir/dirent
  590. X    486      -12           src
  591. .in
  592. .fi
  593. .sp
  594. The control file will contain:
  595. .sp
  596. .nf
  597. .ne 4
  598. .in +.5i
  599. \- for manual page
  600. maildir 6524:6518:::::
  601. maildir/dirent  2:2:::::
  602. maildir/*
  603. !maildir/unimportant
  604. src     486:498:::::
  605. .in
  606. .fi
  607. .sp
  608. It takes very little fantasy to imagine what will happen on subsequent
  609. runs...
  610. .PP
  611. When the contents of the control file are to be changed, e.g. to add
  612. new filenames, a normal text editor can be used. Just add or remove
  613. lines, and they will be taken into account automatically.
  614. .PP
  615. When run without 
  616. .B \-g
  617. or
  618. .B \-u
  619. options, it actually reproduces the report from the previous run.
  620. .PP
  621. When multiple runs are required, save the output of
  622. .IR du (1)
  623. in a file, and pass this file to
  624. .I dusage
  625. using the 
  626. .BI \-i "file"
  627. option.
  628. .SH BUGS
  629. Running the same control file with different values of the 
  630. .B \-f
  631. and
  632. .B \-r
  633. options may cause strange results.
  634. .SH AUTHOR
  635. Johan Vromans, Multihouse Research, Gouda, The Netherlands.
  636. .sp
  637. Send bugs and remarks to <jv@mh.nl> .
  638. SHAR_EOF
  639. chmod 0444 dusage.1 ||
  640. echo 'restore of dusage.1 failed'
  641. Wc_c="`wc -c < 'dusage.1'`"
  642. test 5139 -eq "$Wc_c" ||
  643.     echo 'dusage.1: original size 5139, current size' "$Wc_c"
  644. # ============= dusage.ctl ==============
  645. echo 'x - extracting dusage.ctl (Text)'
  646. sed 's/^X//' << 'SHAR_EOF' > 'dusage.ctl' &&
  647. - for /usr/spool
  648. /usr/spool/batch    2:2:2:2:2:2:2:2
  649. /usr/spool/cron    16:16:16:16:16:16:16:16
  650. /usr/spool/locks    2:2:2:2:2:2:2:2
  651. /usr/spool/lp    570:570:570:570:570:244:240:238
  652. /usr/spool/mqueue    2:2:2:2:2:2:2:2
  653. /usr/spool/news    2:2:2:2:2:2:2:2
  654. /usr/spool/rwho    20:20:20:20:20:20:20:20
  655. /usr/spool/uucp    3188:2964:3484:2836:2890:2222:2128:2072
  656. /usr/spool/uucppublic    14:14:16:16:16:16:16:16
  657. !/usr/spool/oldnews
  658. SHAR_EOF
  659. chmod 0644 dusage.ctl ||
  660. echo 'restore of dusage.ctl failed'
  661. Wc_c="`wc -c < 'dusage.ctl'`"
  662. test 397 -eq "$Wc_c" ||
  663.     echo 'dusage.ctl: original size 397, current size' "$Wc_c"
  664. exit 0
  665. -- 
  666. Johan Vromans                       jv@mh.nl via internet backbones
  667. Multihouse Automatisering bv               uucp: ..!{uunet,hp4nl}!mh.nl!jv
  668. Doesburgweg 7, 2803 PL Gouda, The Netherlands  phone/fax: +31 1820 62911/62500
  669. ------------------------ "Arms are made for hugging" -------------------------
  670.