helpful amanda script

Paul Lussier p.lussier at comcast.net
Fri Aug 25 09:16:01 EDT 2006


"Tom Buskey" <tom at buskey.name> writes:

> On 8/24/06, Greg Rundlett <greg.rundlett at gmail.com> wrote:
>>
>>
>> I am (shudder) on Windows atm, having just added a wireless print
>> server to the home network so I can't check the man page but I recall
>> there is an option or two for displaying the changed parts of the
>> output which really makes 'watch' nice for displaying the output even
>> when it's large.
>
> watch --differences
> and watch --differences=cumulative (like I can remember that spelling w/o
> the man page)

Yeah, that seems to be a lot to type compared to my script name.
Also, my script is slightly better about highlighting the most
important information from the output of this command, which watch
doesn't do.

For example, my script shows me this at the top of the output:

  Fri Aug 25 09:06:23 EDT 2006

  Dumping:
          jpt:/u1/backup/all 0 43728850k  39929984k ( 91.31%) (2:52:36)
          jpt:/u1/backup/archive 0 2559340k  1399520k ( 54.68%) (8:52:51)
          osb:/u1/pgi 0 56889000k  29965344k ( 52.67%) (2:52:51)
          space-monster:/u1/partnersw 0 10235230k  6704408k ( 65.50%) (7:51:29)
          space-monster:/u1/release 0140011180k  22784672k ( 16.27%) (2:53:51)

  Waiting on:      18 file systems

  Tapes written to so far:
    tape 1        :   0         0k         0k (  0.00%) Weekly17
    tape 2        :  23  82854530k  82851285k ( 39.14%) Weekly11

  Using /var/log/amanda/weekly/amdump from Thu Aug 24 22:45:01 EDT 2006

Then it lists the status of all the file systems either flushing, or
being written to tape, or waiting for flushing to tape.

Running watch around essentially the same amstatus command like this:

  watch -n 600 --differences=cumulative \
   "amstatus weekly --dumping --waitdumping  --waittaper --writingtape"

provides me with this:

  Every 600s: amstatus weekly --dumping --waitdumping...  Fri Aug 25 09:11:12 2006

  Using /var/log/amanda/weekly/amdump from Thu Aug 24 22:45:01 EDT 2006
  ad:/private-1/cvsroot                     0  1686410k dump done (5:50:24), wait
  for writing to tape
  ad:/private-1/mysql                       0   249110k dump done (5:52:11), wait
  for writing to tape
  jpt:/u1/backup/all                        0 43728850k dumping 40446324k ( 92.49%
  ) (2:52:36)


So, a) the output is more or less the raw amstatus output, which is
exactly what I was trying to avoid by writing the wrapper script in
the first place, and b) there's no gain here.  I can't quickly tell
what is being dumped, what tapes have been used or how close this is
to finishing...

I suppose what I could do is just replace the loop in my script with a
watch command wrapped around the filtering that my script does, that
might eliminate some unnecessary code.  I'll have to play with it.

> btw - this is from my Cygwin manpage.  Do yourself a favor and put it on
> Windows ;-)

Or, just install Linux over the Windows partition and don't ever worry
about it again :)

-- 
Seeya,
Paul



More information about the gnhlug-discuss mailing list