Brian Cuttler wrote:
I know you can use wrappers for doing similar things on the
amanda client (when the client != server) but I've never quite
gotten that down correctly and I'm looking to start/stop a
database on an amanda client so the files are quiessed during
the dump.

What is the right way to handle surounding tasks on the amanda-client ?
(A brief example if someone doesn't mind too much...)


Here is an untested example.


#!/usr/bin/perl


use Getopt::Long qw(:config pass_through);

$result = GetOptions (
                'directory=s' => \$dir,
                'file=s' => \$file,
                );

$post = 0;
if ($dir eq '/my/special_dir' &&  $file ne '/dev/null') {
    system '/usr/bin/dbshut thedb >/tmp/amanda/dbshut.debug 2>&1';
    # avoid output to stdout!!! stdout fd = the backup image
    # msgs on stderr will be flagged as "strange" in amreport
    # so you could leave out the 2>&1
    $post = 1;
}

# put all options we processed back
unshift(@ARGV, '--directory', $dir);
unshift(@ARGV, '--file', $file;

# now put the real gnutar program in front
unshift(@ARGV, "/usr/local/bin/gtar");

system @ARGV ; # and run it

if ($post) {  # need postprocessing?
    system '/usr/bin/dbstart thedb >/tmp/amanda/dbstart.debug 2>&1';
}


-- Paul Bijnens, Xplanation Tel +32 16 397.511 Technologielaan 21 bus 2, B-3001 Leuven, BELGIUM Fax +32 16 397.512 http://www.xplanation.com/ email: [EMAIL PROTECTED] *********************************************************************** * I think I've got the hang of it now: exit, ^D, ^C, ^\, ^Z, ^Q, F6, * * quit, ZZ, :q, :q!, M-Z, ^X^C, logoff, logout, close, bye, /bye, * * stop, end, F3, ~., ^]c, +++ ATH, disconnect, halt, abort, hangup, * * PF4, F20, ^X^X, :D::D, KJOB, F14-f-e, F8-e, kill -1 $$, shutdown, * * kill -9 1, Alt-F4, Ctrl-Alt-Del, AltGr-NumLock, Stop-A, ... * * ... "Are you sure?" ... YES ... Phew ... I'm out * ***********************************************************************




Reply via email to