Menu

#107 amdump ignores diskname and uses the diskdevice

open
nobody
None
2019-06-27
2019-06-27
Anonymous
No

Originally created by: ndias

If I have something like this in disklist

MACHINE /dir {
tar
exclude "./subdir/*"
}

MACHINE /dir/subdir tar

and run

$ amdump CONF MACHINE ^/dir$
or
$ amdump CONF MACHINE =/dir

It works as expected the only backup made is /dir

But if I have something like this

MACHINE /dir {
tar
exclude "./subdir/*"
}

MACHINE /dir/subdir /dir {
tar
include "./subdir/*"
}

the commands

$ amdump CONF MACHINE ^/dir$
and
$ amdump CONF MACHINE =/dir

Don't work as expected, both backups (/dir and /dir/subdir) are made

From "man disklist"

diskname
The name of the disk (a label). In most case, you set your diskname
to the diskdevice and you don't set the diskdevice. If you want
multiple entries with the same diskdevice, you must set a different
diskname for each entry. It's the diskname that you use on the
commandline for any Amanda command. Look at the example/disklist
file for example.

So from this, if it's the diskname that is used in the command, it
seems that the reality is amdump is using the diskdevice instead!!

more info from Nathan Stratton Treadway nathanst@ontko.com

My understanding of the inner workings of this part of Amanda is quite
fuzzy, but assuming I have followed the program flow behind "amdump"
correctly, it looks like the code in question is found in
server-src/diskfile.c:match_disklist() , which contains the following
lines:
if ([...] &&
(match_disk(sargv[i], dp->name) ||
(dp->device && match_disk(sargv[i], dp->device)))) {

..so I believe that in fact arguments specified on the amdump command line
are matched against BOTH the "diskname" and "diskdevice" fields, and if
either one matches the argument then that DLE is selected.... (which I
agree doesn't match the wording of the manpage....).


Discussion


Log in to post a comment.