Amanda-Users

[Amanda-users] Using the Script API for Pre and Post scripts.

2008-12-09 21:50:09
Subject: [Amanda-users] Using the Script API for Pre and Post scripts.
From: ebelcher <amanda-forum AT backupcentral DOT com>
To: amanda-users AT amanda DOT org
Date: Tue, 09 Dec 2008 21:44:30 -0500
Okay, some results of more research. Using the script-email template, I 
modified it to run my pre and post scripts. I then created a test backup job 
that simply backed up a couple of files onto vtapes. Here is the amanda.conf 
below. It works, enabling and disabling the snapshots.

maxdumps 1
org "test" # your organization name for reports
mailto "ebelcher AT esriaustralia.com DOT au" # space separated list of 
operators at your site
dumpcycle 1 # the number of days in the normal dump cycle
runspercycle 1 # the number of amdump runs in dumpcycle days
# (1 week * 5 amdump runs per week -- just weekdays)
tapecycle 2 # the number of tapes in rotation
# 1 week (dumpcycle) times 5 tapes per week (just
# the weekdays) plus a few to handle errors that
# need amflush and so we do not overwrite the full
# backups performed at the beginning of the previous
# cycle
runtapes 1 # number of tapes to be used in a single run of amdump
tpchanger "chg-disk" # the tape-changer glue script
tapedev "file://var/lib/amanda/vtapes/test" # the no-rewind tape device to be 
used
changerfile "/etc/amanda/test/changer.conf"
changerdev "/dev/null"
tapetype HARDDISK # what kind of tape it is
labelstr "^test-[0-9][0-9]*$" # label constraint regex: all tapes must match
dtimeout 1800 # number of idle seconds before a dump is aborted.
ctimeout 30 # maximum number of seconds that amcheck waits
# for each client host
etimeout 300 # number of seconds per filesystem for estimates.

define script-tool db_ss {
comment "Snapshot and Process db_images"
plugin "script-db_system"
execute-where client
execute-on pre-dle-estimate, post-dle-backup
}



define dumptype global {
comment "Global definitions"
auth "bsdtcp"
}

#define application-tool and dumptype for the amgtar application
define application-tool app_amgtar {
comment "amgtar"
plugin "amgtar"
#property "GNUTAR-PATH" "/path/to/gtar"
#property "GNUTAR-LISTDIR" "/path/to/gnutar_list_dir"
}

define dumptype gui-base {
global
program "APPLICATION"
application "app_amgtar"
comment "gui base dumptype dumped with tar"
compress none
index yes
script "db_ss"
}

define tapetype HARDDISK {
length 1000 mb
}

label_new_tapes "test-%%%"
reserve 100
includefile "./advanced.conf"
includefile "/etc/amanda/template.d/dumptypes"
includefile "/etc/amanda/template.d/tapetypes"


my real backup job using the same script doesn't work. The logs don't even show 
the script ever being called.

example from test job: 1228874456.897893: sendbackup: Spawning 
"/usr/lib/amanda/application/script-db_system script-db_system POST-DLE-BACKUP 
--config test --host



Below is the conf for the real backup job that doesn't work.

maxdumps 1
org "db_system" # your organization name for reports
mailto "sysadmin AT esriaustralia.com DOT au" # space separated list of 
operators at your site
dumpcycle 3 # the number of days in the normal dump cycle
runspercycle 3 # the number of amdump runs in dumpcycle days
# (1 week * 5 amdump runs per week -- just weekdays)
tapecycle 7 # the number of tapes in rotation
# 1 week (dumpcycle) times 5 tapes per week (just
# the weekdays) plus a few to handle errors that
# need amflush and so we do not overwrite the full
# backups performed at the beginning of the previous
# cycle
runtapes 1 # number of tapes to be used in a single run of amdump
tpchanger "chg-zd-mtx" # the tape-changer glue script
tapedev "/dev/nst0" # the no-rewind tape device to be used
changerfile "/etc/amanda/db_system/changer.conf"
changerdev "/dev/sg5"
tapetype IBMTS3200-LTO4 # what kind of tape it is (see tapetypes below)

holdingdisk hd2 {
directory "/var/lib/amanda/holdings/db_system"
use 1000 Mb
}


define script-tool db_ss {
comment "Snapshot and Process db_images"
plugin "script-db_system"
execute-where client
execute-on pre-dle-estimate, post-dle-backup
}


labelstr "^db_system-[0-9][0-9]*$" # label constraint regex: all tapes must 
match

dtimeout 1800 # number of idle seconds before a dump is aborted.
ctimeout 30 # maximum number of seconds that amcheck waits
# for each client host
etimeout 300 # number of seconds per filesystem for estimates.

define dumptype global {
comment "Global definitions"
auth "bsdtcp"
}

#define application-tool and dumptype for the amgtar application
define application-tool app_amgtar {
comment "amgtar"
plugin "amgtar"
#property "GNUTAR-PATH" "/path/to/gtar"
#property "GNUTAR-LISTDIR" "/path/to/gnutar_list_dir"
}

define dumptype gui-base {
global
program "APPLICATION"
application "app_amgtar"
comment "gui base dumptype dumped with tar"
compress none
index yes
script "db_ss"
}


reserve 100
includefile "./advanced.conf"
includefile "/etc/amanda/template.d/dumptypes"
includefile "/etc/amanda/template.d/tapetypes"

It would be good to understand why the test works and the other doesn't?

+----------------------------------------------------------------------
|This was sent by sysadmin AT esriaustralia.com DOT au via Backup Central.
|Forward SPAM to abuse AT backupcentral DOT com.
+----------------------------------------------------------------------