Re: amflush run while amdump underway tries to flush .tmp files

2017-11-20 Thread Nathan Stratton Treadway
On Mon, Nov 20, 2017 at 19:03:52 -0500, Nathan Stratton Treadway wrote:
> On Mon, Nov 20, 2017 at 14:42:01 -0500, Jean-Louis Martineau wrote:
> > +   if (open(my $pidh,  $pidfn)) {
> > +   my $pid = <$pidh>;
> > +   if (kill($pid, 0) == 0) {
> > +   # pid is alive, skip this directory
> > +   next;
> > +   }
> 
> looks like the order of arguments for the kill() function is reversed in
> Perl, so the above code fails.  I will send a patch with a fix shortly.

When I tried using amflush after applying this patch, I found that
it was never finding any directories it was willing to flush.

When I debugged a little, I discovered that the Perl kill function
actually has arguments in reverse order:
  kill SIGNAL, LIST

However, even after fixing that function call amflush still didn't find
any directories it was willing to flush.  Debugging further revealed
that the "Amanda::Util::setup_application()" call at the top of the
amflush script ends up (via holding.c) taking over the pid file -- but
using the parent pid rather than the current process pid.  In the case
of amflush, the parent pid is the shell that invoked amflush, so it's
still running when the program flow reaches the call to
Amanda::Holding::get_all_datestamps() , and thus the _walk function
always thought the directory-lock was still validly held.

The attached patch attempts to fix those problems... but the logic to
deal with all the above conditions was complex enough that I figured it
would work better to move it into a separate function.

I have not fully tested this patch yet, but figured I'd send it back so
you can take a look at it and see if it seems liek the right approach.

(For example, let me know if you can think of a better name than
"_valid_locking_pid".)


Nathan

p.s. I based the kill() ==0/$! == Errno::EPERM logic off of the
discussion found here:
  https://unix.stackexchange.com/a/294990
(i.e. the answer by Stephen Harris found in:
  
https://unix.stackexchange.com/questions/294984/how-should-i-check-whether-a-given-pid-is-running/
)



Nathan Stratton Treadway  -  natha...@ontko.com  -  Mid-Atlantic region
Ray Ontko & Co.  -  Software consulting services  -   http://www.ontko.com/
 GPG Key: http://www.ontko.com/~nathanst/gpg_key.txt   ID: 1023D/ECFB6239
 Key fingerprint = 6AD8 485E 20B9 5C71 231C  0C32 15F3 ADCD ECFB 6239


Re: amflush run while amdump underway tries to flush .tmp files

2017-11-20 Thread Nathan Stratton Treadway
On Mon, Nov 20, 2017 at 14:42:01 -0500, Jean-Louis Martineau wrote:
> + if (open(my $pidh,  $pidfn)) {
> + my $pid = <$pidh>;
> + if (kill($pid, 0) == 0) {
> + # pid is alive, skip this directory
> + next;
> + }

looks like the order of arguments for the kill() function is reversed in
Perl, so the above code fails.  I will send a patch with a fix shortly.

Nathan



Nathan Stratton Treadway  -  natha...@ontko.com  -  Mid-Atlantic region
Ray Ontko & Co.  -  Software consulting services  -   http://www.ontko.com/
 GPG Key: http://www.ontko.com/~nathanst/gpg_key.txt   ID: 1023D/ECFB6239
 Key fingerprint = 6AD8 485E 20B9 5C71 231C  0C32 15F3 ADCD ECFB 6239


Re: amflush run while amdump underway tries to flush .tmp files

2017-11-20 Thread Jean-Louis Martineau
On 20/11/17 02:56 PM, Nathan Stratton Treadway wrote:
> On Mon, Nov 20, 2017 at 14:42:01 -0500, Jean-Louis Martineau wrote:
> > Each process should take a lock on the holding directory (a pid file),
>
> Okay, makes sense.
>
>
> > + my $pidfn = File::Spec->catfile($dirfn, "pid");
> > + if (open(my $pidh, $pidfn)) {
> > + my $pid = <$pidh>;
> > + if (kill($pid, 0) == 0) {
> > + # pid is alive, skip this directory
> > + next;
> > + }
> > + close($pidh);
>
> Quick question: does the above leave $pidh open in the case that pid is
> alive? (That is, if the code hits the "next" does that miss a needed
> call to close()?)

perl automatically close it when it come out of scope.
The close should before the 'if (kill' line.

I appreciate your reviews

Jean-Louis
>
> Nathan
>
>
> 
> Nathan Stratton Treadway - natha...@ontko.com - Mid-Atlantic region
> Ray Ontko & Co. - Software consulting services - http://www.ontko.com/ 
> 
> GPG Key: http://www.ontko.com/~nathanst/gpg_key.txt 
>  
> ID: 1023D/ECFB6239
> Key fingerprint = 6AD8 485E 20B9 5C71 231C 0C32 15F3 ADCD ECFB 6239
This message is the property of CARBONITE, INC. and may contain confidential or 
privileged information.
If this message has been delivered to you by mistake, then do not copy or 
deliver this message to anyone.  Instead, destroy it and notify me by reply 
e-mail


Re: amflush run while amdump underway tries to flush .tmp files

2017-11-20 Thread Nathan Stratton Treadway
On Mon, Nov 20, 2017 at 14:42:01 -0500, Jean-Louis Martineau wrote:
> Each process should take a lock on the holding directory (a pid file), 

Okay, makes sense.


> + my $pidfn = File::Spec->catfile($dirfn, "pid");
> + if (open(my $pidh,  $pidfn)) {
> + my $pid = <$pidh>;
> + if (kill($pid, 0) == 0) {
> + # pid is alive, skip this directory
> + next;
> + }
> + close($pidh);

Quick question: does the above leave $pidh open in the case that pid is
alive?  (That is, if the code hits the "next" does that miss a needed
call to close()?)

Nathan



Nathan Stratton Treadway  -  natha...@ontko.com  -  Mid-Atlantic region
Ray Ontko & Co.  -  Software consulting services  -   http://www.ontko.com/
 GPG Key: http://www.ontko.com/~nathanst/gpg_key.txt   ID: 1023D/ECFB6239
 Key fingerprint = 6AD8 485E 20B9 5C71 231C  0C32 15F3 ADCD ECFB 6239


Re: amflush run while amdump underway tries to flush .tmp files

2017-11-20 Thread Jean-Louis Martineau
Each process should take a lock on the holding directory (a pid file), 
The attached path fix it.

Please try it.


On 17/11/17 12:38 AM, Nathan Stratton Treadway wrote:
> (Amanda v3.5)
>
> I noticed that Amanda 3.5 no longer aborts amflush if amdump is
> currently running (as older versions of Amanda do).
>
> So out of curiousity I kicked of "amflush TestBackup" while amdump was
> busy dumping to the holding disk... and I discovered that amflush
> actually tries to go ahead and flush the ".tmp" file files that it finds
> in the holding directory:
>
> = From /var/log/amanda/server/TestBackup/amflush.20171116200510.debug:
> Thu Nov 16 20:05:17.590062176 2017: pid 26860: thd-0x2f07e00: amflush: 
> flushing /amanda/TestBackup-holding/2017111622/client1._.0.tmp
> Thu Nov 16 20:05:17.590096226 2017: pid 26860: thd-0x2f07e00: amflush: 
> flushing /amanda/TestBackup-holding/2017111622/client2._.1.tmp
> =
>
> In this case the taper failed (and thus the amflush didn't actually do
> anything with the .tmp files):
>
> = From /var/log/amanda/TestBackup/amdump.1:
> driver: send-cmd time 14.132 to taper0: FILE-WRITE worker0-0 00-2 
> /amanda/TestBackup-holding/2017111622/client1._.0.tmp client1 / 0 
> 2017111622 "" "" "" "" "" "" "" "" 0
> writing taper command 'FILE-WRITE worker0-0 00-2 
> /amanda/TestBackup-holding/2017111622/client1._.0.tmp client1 / 0 
> 2017111622 "" "" "" "" "" "" "" "" 0
> ' failed: Broken pipe
> =
> (There is a line break in the log file just before "' failed".)
>
>
> = From /var/log/amanda/server/TestBackup/taper.20171116200517.debug:
> Thu Nov 16 20:05:18.502419601 2017: pid 26862: thd-0x4232000: taper: 
> Building type SPLIT_FILE header of 32768-32768 bytes with 
> name='client1' disk='/' dumplevel=0 and blocksize=32768
> Thu Nov 16 20:05:22.427709157 2017: pid 26862: thd-0x4232050: taper: 
> no next_filename
> Thu Nov 16 20:05:22.427743969 2017: pid 26862: thd-0x4232050: taper: 
> sending XMSG_CRC message
> Thu Nov 16 20:05:22.427748905 2017: pid 26862: thd-0x4232050: taper: 
> xfer-source-holding CRC: 2e4f7128 size: 249856000
> Thu Nov 16 20:05:22.427757739 2017: pid 26862: thd-0x4232050: taper: 
> xfer_queue_message: MSG:  elt= version=0>
> Thu Nov 16 20:05:22.427767783 2017: pid 26862: thd-0x4232050: taper: 
> xfer-source-holding sending XMSG_DONE message
> Thu Nov 16 20:05:22.427773216 2017: pid 26862: thd-0x4232050: taper: 
> xfer_queue_message: MSG:  elt= version=0>
> [ *** file ends abruptly here ***]
> =
>
>
>  but whether or not that indicates a bug in the taper, it seems like
> amflush should not ever try to flush .tmp files from the holding disk...
> (right?)
>
>
>
> Finally, after this testing I notice that the command_file still has
> FLUSH commands for those .tmp files (even though neither the files nor
> the containing holding directory now exist). I've run both "amdump" and
> "amflush" since then, and tried "amcleanup" as well. Is there any
> (good) way to clean up these orphan commands?
No, you must manually remove them. Do it when no other amanda processes 
are running.

Jean-Louis
>
> = From /etc/amanda/TestBackup/command_file:
> ID 1633
> 1603 FLUSH TestBackup 
> /amanda/TestBackup-holding/2017111622/client1._.0.tmp client1 / 
> 2017111622 0 TestBackup WORKING:17072 TODO
> 1604 FLUSH TestBackup 
> /amanda/TestBackup-holding/2017111622/client2._.1.tmp client2 / 
> 2017111622 0 TestBackup WORKING:17072 TODO
> =
>
> =
> # ls -l /amanda/TestBackup-holding/
> total 0
> =
>
>
> Nathan
>
> 
> Nathan Stratton Treadway - natha...@ontko.com - Mid-Atlantic region
> Ray Ontko & Co. - Software consulting services - http://www.ontko.com/ 
> 
> GPG Key: http://www.ontko.com/~nathanst/gpg_key.txt 
>  
> ID: 1023D/ECFB6239
> Key fingerprint = 6AD8 485E 20B9 5C71 231C 0C32 15F3 ADCD ECFB 6239
This message is the property of CARBONITE, INC. and may contain confidential or 
privileged information.
If this message has been delivered to you by mistake, then do not copy or 
deliver this message to anyone.  Instead, destroy it and notify me by reply 
e-mail
diff --git a/perl/Amanda/Holding.pm b/perl/Amanda/Holding.pm
index 88f1fd8..5b550c9 100644
--- a/perl/Amanda/Holding.pm
+++ b/perl/Amanda/Holding.pm
@@ -199,7 +199,7 @@ sub _is_datestr {
 }
 
 sub _walk {
-my ($file_fn, $verbose) = @_;
+my ($file_fn, $verbose, $take_pid) = @_;
 
 # walk disks, directories, and files with nested loops
 for my $disk (disks()) {
@@ -229,6 +229,21 @@ sub _walk {
 		next;
 	}
 
+	my $pidfn = File::Spec->catfile($dirfn, "pid");
+	if (open(my $pidh,  $pidfn)) {
+		my $pid = <$pidh>;
+		if (kill($pid, 0) == 0) {
+		# 

Re: "vaulting run" amdump email report issues -- driver.c "nodump" option

2017-11-20 Thread Jean-Louis Martineau
Nathan,

I was too fast to write the first patch, and you are completely right.

I committed the attached patch,now amflush use the --no-dump argument 
and driver merge both 'nodump' and '--no-dump'.

Jean-Louis

On 18/11/17 01:11 AM, Nathan Stratton Treadway wrote:
> On Thu, Nov 16, 2017 at 10:15:28 -0500, Jean-Louis Martineau wrote:
> > Nathan,
> >
> > Try this patch.
> >
> > run: amdump --no-dump --no-flush CONFIG
> > Will do all scheduled vault to the vault-storage
>
> [...]
>
> > diff --git a/server-src/driver.c b/server-src/driver.c
> > index 351494a..fd01296 100644
> > --- a/server-src/driver.c
> > +++ b/server-src/driver.c
> > @@ -107,6 +107,10 @@ static int taper_started = 0;
> > static int nb_storage;
> > static cmddatas_t *cmddatas = NULL;
> >
> > +static int no_dump = FALSE;
> > +//static int no_flush = FALSE;
> > +static int no_vault = FALSE;
> > +
> > static int wait_children(int count);
> > static void wait_for_children(void);
> > static void allocate_bandwidth(netif_t *ip, unsigned long kps);
> > @@ -305,6 +309,30 @@ main(
> > }
> >
> > if (argc > 2) {
> > + if (g_str_equal(argv[2], "--no-dump")) {
> > + no_dump = TRUE;
> > + argv++;
> > + argc--;
> > + }
> > + }
>
> I noticed when reviewing the log file from my "amdump --no-dump" run
> that there were still "INFO dumper" lines in there, from when the
> dumpers start up at the beginning of the run and when they terminate at
> the end (with no activity in between).
>
> I wondered if the dumpers should be getting started at all when no_dump
> is true, and took a look at driver.c to see how the dumpers were getting
> kicked off -- and discovered that driver.c already implements a "nodump"
> option, and that indeed if that option is enabled, the dumper processes
> are not spawned.
>
> (I see that this "nodump" option is used by Amflush.pm 
> .)
>
> Anyway, I guess the question is whether it makes sense to merge the new
> --no-dump and original nodump options for driver.c, at least as far as
> having one internal boolean variable to handle both -- or, if not,
> if there are any places where the code currently checks for !nodump
> where !no_dump should be treated equivalently?
>
> Nathan
>
>
>
> 
> Nathan Stratton Treadway - natha...@ontko.com - Mid-Atlantic region
> Ray Ontko & Co. - Software consulting services - http://www.ontko.com/ 
> 
> GPG Key: http://www.ontko.com/~nathanst/gpg_key.txt 
>  
> ID: 1023D/ECFB6239
> Key fingerprint = 6AD8 485E 20B9 5C71 231C 0C32 15F3 ADCD ECFB 6239
This message is the property of CARBONITE, INC. and may contain confidential or 
privileged information.
If this message has been delivered to you by mistake, then do not copy or 
deliver this message to anyone.  Instead, destroy it and notify me by reply 
e-mail
diff --git a/perl/Amanda/Amflush.pm b/perl/Amanda/Amflush.pm
index f2f8aa2..8323733 100644
--- a/perl/Amanda/Amflush.pm
+++ b/perl/Amanda/Amflush.pm
@@ -317,10 +317,9 @@ sub run {
 	POSIX::close($driver_pipe);
 	POSIX::dup2(fileno($self->{'amdump_log'}), 1);
 	POSIX::dup2(fileno($self->{'amdump_log'}), 2);
-	debug("exec: " . join(' ', $driver, $self->{'config'}, "nodump", "--no-vault",
-   @log_filename, @config_overrides));
+	debug("exec: " . join(' ', $driver, $self->{'config'}, @log_filename, "--no-dump", "--no-vault", @config_overrides));
 	close($self->{'amdump_log'});
-	exec $driver, $self->{'config'}, "nodump", "--no-vault", @log_filename,
+	exec $driver, $self->{'config'}, @log_filename, "--no-dump", "--no-vault", 
 		  @config_overrides;
 	die "Could not exec $driver: $!";
 }
diff --git a/server-src/driver.c b/server-src/driver.c
index fd01296..1625d06 100644
--- a/server-src/driver.c
+++ b/server-src/driver.c
@@ -79,8 +79,6 @@ static off_t total_disksize;
 static char *dumper_program;
 static char *chunker_program;
 static int  inparallel;
-static int nodump = 0;
-static int novault = 0;
 static storage_t *storage;
 static int conf_max_dle_by_volume;
 static int conf_taperalgo;
@@ -274,22 +272,6 @@ main(
 set_config_overrides(cfg_ovr);
 argv0 = argv[0];
 
-if(argc > 2) {
-if(g_str_equal(argv[2], "nodump")) {
-nodump = 1;
-	argv++;
-	argc--;
-}
-}
-
-if(argc > 2) {
-if(g_str_equal(argv[2], "--no-vault")) {
-novault = 1;
-	argv++;
-	argc--;
-}
-}
-
 log_filename = NULL;
 if (argc > 3) {
 	if (g_str_equal(argv[2], "--log-filename")) {
@@ -393,7 +375,7 @@ main(
 
 /* check that we don't do many dump in a day and usetimestamps is off */
 if(strlen(driver_timestamp) == 8) {
-	if (!nodump) {
+	if (!no_dump) {
 	char *conf_logdir = config_dir_relative(getconf_str(CNF_LOGDIR));
 	char *logfile= g_strjoin(NULL, conf_logdir, "/log.",
 	 driver_timestamp, ".0", NULL);
@@ -533,7 +515,7 @@ main(
 nb_storage 

Re: amvault and label problem as of 3.4.5

2017-11-20 Thread Jean-Louis Martineau

On 20/11/17 10:54 AM, Winston Sorfleet wrote:

Thanks Nathan... I have tried the command line without any -o options:

|/usr/sbin/amvault  --latest-fulls --dest-storage "HP G2 Robot" vtl
|

Now the response is "FATAL amvault no 'tape-device' property 
specified" which doesn't make sense to me, since the storage 
definition includes a tapedev string.


|/define changer "HP G2" {//
//tpchanger "chg-robot:/dev/LTOchanger"//
//property "tape-device" "0=tape:/dev/nst0"//
//property "use-slots" "1-7"//
//property "load-poll" "13s poll 5s"//
//device-property "LEOM" "TRUE" //
//}/
...

define storage "HP G2 Robot" {||
||tapedev "HP G2"||
||tapetype "LTO2"||
||tapepool "$r"||
||tpchanger "chg-robot:/dev/LTOchanger"||
||labelstr "Vault-[1-7]"||
||autolabel "Vault-%" any||
||}|


|Try with:

define storage "HP G2 Robot" {||
||tapetype "LTO2"||
||tapepool "$r"||
||tpchanger "HP G2"||
||labelstr "Vault-[1-7]"||
||autolabel "Vault-%" any||
||}


|



Nevertheless, if I manually specify a tapedev in the amvault command line

|/usr/sbin/amvault -otapedev='HP G2' --latest-fulls --dest-storage
"HP G2 Robot" vtl

|

/Now/ I see the robot cycling through tapes to no avail (progress?), 
finally going through the cleaning slot, but... well here is the logfile:|


|

|INFO amvault amvault pid 20654
START amvault date 20171120102558
STATS amvault hostname flamen
INFO amvault vaulting
DISK amvault flamen.romanus.ca

/
DISK amvault flamen.romanus.ca

/home
DISK amvault pomerium.romanus.ca

/
DISK amvault forum.romanus.ca

/
INFO taper Slot 5 is a device in error: Can't open tape device HP
G2: No such file or directory, autolabel disabled
INFO taper Slot 6 is a device in error: Can't open tape device HP
G2: No such file or directory, autolabel disabled
INFO taper Slot 7 is a device in error: Can't open tape device HP
G2: No such file or directory, autolabel disabled
INFO taper Slot 8 is a device in error: Can't open tape device HP
G2: No such file or directory, autolabel disabled
INFO taper error from mtx: Unloading drive 0 into Storage Element
8...Cleaning Cartridge Installed and Ejected
FATAL amvault error from mtx: Unloading drive 0 into Storage
Element 8...Cleaning Cartridge Installed and Ejected
FINISH driver fake driver finish
FINISH amvault date 20171120102558 time 226
INFO amvault pid-done 20654
FATAL amvault Taper::Scan did not quit at
/usr/lib/x86_64-linux-gnu/amanda/perl/Amanda/Taper/Scan.pm line
347 during global destruction.
|

Obvious oddities:

 1. "|device in error: Can't open tape device HP G2: No such file or
directory"?|
 2. "|driver fake driver finish"? |

|
|Configuration files and log in 
https://drive.google.com/open?id=0B_vw5EcgO15lXzJwQVk3UXpkTUE


||


||


On 2017-11-18 08:44 PM, Nathan Stratton Treadway wrote:

On Sat, Nov 18, 2017 at 18:20:14 -0500, Winston Sorfleet wrote:

As of 3.4.5 --dst-changer is deprecated, so I have to use a storage
template from amanda.conf.  I have defined a storage template as follows:

 |define storage "HP G2 Robot" {
 tapedev "HP G2"
 tapetype "LTO2"
 #tpchanger "chg-robot:/dev/LTOchanger"
 #autolabel "Vault-%"
 labelstr "Vault-[1-7]"
 }
 |

Now the monthly cron line /I thought/ should be:

 |/usr/sbin/amvault -q -otapetype="LTO2" -otapecycle=5
 -olabelstr="Vault-[1-7]" -otapedev="HP G2" --latest-fulls
 --dest-storage "HP G2 Robot" vtl|

However, this gives me an error message:

 |argument 'Vault-[1-7]': labelstr template or MATCH_AUTOLABEL expected
 argument 'Vault-[1-7]': labelstr template or MATCH_AUTOLABEL expected
 errors processing config file
 |

I haven't looked at your full config yet, but a few quick notes:

* The underlying cause of this particular error message from the -o
   option is that Amanda is explicitly looking a String object for the
   template value.  You should be able to work around that quirk
   with nested quotes, something like

 amvault ... '-olabelstr="Vault-[1-7]"' ...

* That aside, though, it really should sufficient to define the labelstr
   in the storage definition itself; you shouldn't need to specify the
   labelstr on the command line at all.  If that's not working it's
   probably worth further investigation to figure out why.  (In fact,
   with the use of a 'policy' on the HP storage, you shouldn't need any of
   the "-o" options on the amvault line, I believe.)

* The Wiki page
 http://wiki.zmanda.com/index.php/How_To:Copy_Data_from_Volume_to_Volume
   might have some useful hints.

Nathan



Re: amvault and label problem as of 3.4.5

2017-11-20 Thread Winston Sorfleet
Thanks Nathan... I have tried the command line without any -o options:

|/usr/sbin/amvault  --latest-fulls --dest-storage "HP G2 Robot" vtl
|

Now the response is "FATAL amvault no 'tape-device' property specified"
which doesn't make sense to me, since the storage definition includes a
tapedev string.

|/define changer "HP G2" {//
//    tpchanger "chg-robot:/dev/LTOchanger"//
//    property "tape-device" "0=tape:/dev/nst0"//
//    property "use-slots" "1-7"//
//    property "load-poll" "13s poll 5s"//
//    device-property "LEOM" "TRUE" //
//}/
...

define storage "HP G2 Robot" {||
||    tapedev "HP G2"||
||    tapetype "LTO2"||
||    tapepool "$r"||
||    tpchanger "chg-robot:/dev/LTOchanger"||
||    labelstr "Vault-[1-7]"||
||    autolabel "Vault-%" any||
||}|

Nevertheless, if I manually specify a tapedev in the amvault command line

|/usr/sbin/amvault -otapedev='HP G2' --latest-fulls --dest-storage
"HP G2 Robot" vtl

|

/Now/ I see the robot cycling through tapes to no avail (progress?),
finally going through the cleaning slot, but... well here is the logfile:|

|

|INFO amvault amvault pid 20654
START amvault date 20171120102558
STATS amvault hostname flamen
INFO amvault vaulting
DISK amvault flamen.romanus.ca /
DISK amvault flamen.romanus.ca /home
DISK amvault pomerium.romanus.ca /
DISK amvault forum.romanus.ca /
INFO taper Slot 5 is a device in error: Can't open tape device HP
G2: No such file or directory, autolabel disabled
INFO taper Slot 6 is a device in error: Can't open tape device HP
G2: No such file or directory, autolabel disabled
INFO taper Slot 7 is a device in error: Can't open tape device HP
G2: No such file or directory, autolabel disabled
INFO taper Slot 8 is a device in error: Can't open tape device HP
G2: No such file or directory, autolabel disabled
INFO taper error from mtx: Unloading drive 0 into Storage Element
8...Cleaning Cartridge Installed and Ejected
FATAL amvault error from mtx: Unloading drive 0 into Storage Element
8...Cleaning Cartridge Installed and Ejected
FINISH driver fake driver finish
FINISH amvault date 20171120102558 time 226
INFO amvault pid-done 20654
FATAL amvault Taper::Scan did not quit at
/usr/lib/x86_64-linux-gnu/amanda/perl/Amanda/Taper/Scan.pm line 347
during global destruction.
|

Obvious oddities:

 1. "|device in error: Can't open tape device HP G2: No such file or
directory"?|
 2. "|driver fake driver finish"?  |

|
|Configuration files and log in
https://drive.google.com/open?id=0B_vw5EcgO15lXzJwQVk3UXpkTUE

||


||


On 2017-11-18 08:44 PM, Nathan Stratton Treadway wrote:
> On Sat, Nov 18, 2017 at 18:20:14 -0500, Winston Sorfleet wrote:
>> As of 3.4.5 --dst-changer is deprecated, so I have to use a storage
>> template from amanda.conf.  I have defined a storage template as follows:
>>
>> |define storage "HP G2 Robot" {
>>     tapedev "HP G2"
>>     tapetype "LTO2"
>>     #tpchanger "chg-robot:/dev/LTOchanger"
>>     #autolabel "Vault-%"
>>     labelstr "Vault-[1-7]"
>> }
>> |
>>
>> Now the monthly cron line /I thought/ should be:
>>
>> |/usr/sbin/amvault -q -otapetype="LTO2" -otapecycle=5
>> -olabelstr="Vault-[1-7]" -otapedev="HP G2" --latest-fulls
>> --dest-storage "HP G2 Robot" vtl|
>>
>> However, this gives me an error message:
>>
>> |argument 'Vault-[1-7]': labelstr template or MATCH_AUTOLABEL expected
>> argument 'Vault-[1-7]': labelstr template or MATCH_AUTOLABEL expected
>> errors processing config file
>> |
> I haven't looked at your full config yet, but a few quick notes:
>
> * The underlying cause of this particular error message from the -o
>   option is that Amanda is explicitly looking a String object for the
>   template value.  You should be able to work around that quirk 
>   with nested quotes, something like
>
> amvault ... '-olabelstr="Vault-[1-7]"' ...
>
> * That aside, though, it really should sufficient to define the labelstr
>   in the storage definition itself; you shouldn't need to specify the
>   labelstr on the command line at all.  If that's not working it's
>   probably worth further investigation to figure out why.  (In fact,
>   with the use of a 'policy' on the HP storage, you shouldn't need any of
>   the "-o" options on the amvault line, I believe.)
>
> * The Wiki page 
> http://wiki.zmanda.com/index.php/How_To:Copy_Data_from_Volume_to_Volume
>   might have some useful hints.
>
>   Nathan
>
>
> 
> Nathan Stratton Treadway  -  natha...@ontko.com  -  Mid-Atlantic region
> Ray Ontko & Co.  -  Software consulting services  -   http://www.ontko.com/
>  GPG Key: http://www.ontko.com/~nathanst/gpg_key.txt   ID: 1023D/ECFB6239
>  Key