Amtoc: Difference between revisions

From wiki.zmanda.com
Jump to navigation Jump to search
No edit summary
 
(formatting)
Line 13: Line 13:
==OPTIONS==
==OPTIONS==


-a The output file name will be label-of-the-tape.toc in the same directory as logfile.
; -a : The output file name will be label-of-the-tape.toc in the same directory as logfile.
-i Display help about amtoc.
 
-t Generate the output in tabular form.
; -i : Display help about amtoc.
-f file  Write the output to a file ('-' for stdout).
 
-s subs  Evaluate the output file name from subs, with $_ set to label-of-the-tape. The -a option is equivalent to -s 's/$_/.toc/'.
; -t : Generate the output in tabular form.
-w Separate tapes with form-feeds and display blank lines before totals.
 
-- Marks the last option so the next parameter is the logfile.
; -f ''file'' : Write the output to a file ('-' for stdout).
logfile (use '-' for stdin)
 
; -s ''subs'' : Evaluate the output file name from subs, with $_ set to label-of-the-tape. The -a option is equivalent to -s 's/$_/.toc/'.
 
; -w : Separate tapes with form-feeds and display blank lines before totals.
 
; -- : Marks the last option so the next parameter is the logfile.
 
; ''logfile'' : (use '-' for stdin)


==OUTPUT FORMAT==
==OUTPUT FORMAT==
Line 34: Line 41:
  103  cuisg11:/  19991005  0  4139136
  103  cuisg11:/  19991005  0  4139136
  103  total:  -  -  16716288
  103  total:  -  -  16716288


In tabular format (-t), this would look like:
In tabular format (-t), this would look like:


   #  Server:/partition          date      lev  size[Kb]
   #  Server:/partition          date      lev  size[Kb]
Line 50: Line 55:


The easiest way to use it is to run amtoc right after amdump in the cron job:
The easiest way to use it is to run amtoc right after amdump in the cron job:


amdump daily ; logdir=`amgetconf daily logdir` ; log=`ls -1t $logdir/log.*.[0-9] | head -1` ; amtoc -a $log
amdump daily ; logdir=`amgetconf daily logdir` ; log=`ls -1t $logdir/log.*.[0-9] | head -1` ; amtoc -a $log
Line 58: Line 62:
==SEE ALSO==
==SEE ALSO==


amanda(8), amdump(8), amflush(8), amgetconf(8), cron, perl
[[amanda]](8), [[amdump]](8), [[amflush]](8), [[amgetconf]](8), cron, perl


==AUTHOR==
==AUTHOR==

Revision as of 00:36, 2 December 2005

Name

amtoc — generate TOC (Table Of Contents) for an AMANDA run

Synopsis

amtoc [-a ] [-i ] [-t ] [ -f file ] [ -s subs ] [-w ] [-- ] logfile

DESCRIPTION

Amtoc generates a table of contents for an AMANDA run. It's a perl script (if you don't have perl, install it first!).

OPTIONS

-a
The output file name will be label-of-the-tape.toc in the same directory as logfile.
-i
Display help about amtoc.
-t
Generate the output in tabular form.
-f file
Write the output to a file ('-' for stdout).
-s subs
Evaluate the output file name from subs, with $_ set to label-of-the-tape. The -a option is equivalent to -s 's/$_/.toc/'.
-w
Separate tapes with form-feeds and display blank lines before totals.
--
Marks the last option so the next parameter is the logfile.
logfile
(use '-' for stdin)

OUTPUT FORMAT

The standard output has five fields separated by two spaces:


#  Server:/partition  date  level  size[Kb]
0  daily-05:  19991005  -  -
1  cuisun15:/cuisun15/home  19991005  1  96
2  cuinfs:/export/dentiste  19991005  1  96
 ...
103  cuisg11:/  19991005  0  4139136
103  total:  -  -  16716288

In tabular format (-t), this would look like:

  #  Server:/partition           date      lev  size[Kb]
  0  daily-05:                   19991005    -         -
  1  cuisun15:/cuisun15/home     19991005    1        96
  2  cuinfs:/export/dentiste     19991005    1        96
  ...
103  cuisg11:/                   19991005    0   4139136
103  total:                      -           -  16716288

USAGE

The easiest way to use it is to run amtoc right after amdump in the cron job:

amdump daily ; logdir=`amgetconf daily logdir` ; log=`ls -1t $logdir/log.*.[0-9] | head -1` ; amtoc -a $log

which will generate /usr/local/etc/amanda//daily/tape_label.toc. You may also want to call amtoc after an amflush.

SEE ALSO

amanda(8), amdump(8), amflush(8), amgetconf(8), cron, perl

AUTHOR

Nicolas Mayencourt <[email protected]>, University of Geneva/Switzerland : Original text

Stefan G. Weichinger, <[email protected]>, maintainer of the AMANDA-documentation: XML-conversion