On 02/18/2015 01:17 PM, Debra S Baddorf wrote:
(a) oops, I didn’t mean to write plural. Just singular.
amadmin <config> tape
(b) the flag doesn’t work for me. I’m at version 3.3.7.
RedHat; I compiled from a tar ball.
The flag is completely ignored.
I wonder what makes the difference??
You are right, the --days is ignored, I think it is broken since 3.3.2
I committed a fix (it is attached).
You can do the following to get a similar result:
DAYS=10 # or the value you want
RUNTAPES=`amgetconf CONF runtapes`
NEW_RUNTAPES=`expr $RUNTAPES \* $DAYS`
amadmin CONF tape -oruntapes=$NEW_RUNTAPES
Jean-Louis
Deb Baddorf
Fermilab
On Feb 18, 2015, at 8:41 AM, Cuttler, Brian (HEALTH)
<brian.cutt...@health.ny.gov> wrote:
Deb,
I hadn't been aware of that flag, good catch.
The switch does function for me.
You used "tapes", rather than "tape"(?)
# amadmin curie tape --days 1
The next Amanda run should go onto tape Curie510 or a new tape
tape Curie511 or a new tape
# amadmin curie tape --days 2
The next Amanda run should go onto tape Curie510 or a new tape
tape Curie511 or a new tape
The next Amanda run should go onto tape Curie512 or a new tape
tape Curie513 or a new tape
so if your version of amanda supports this, searching the list of tapes (and
finding them) in the library for these tapes should give Stefan what he was
looking for.
Brian
[Still at Wadsworth, only the email has changed]
-----Original Message-----
From: owner-amanda-us...@amanda.org [mailto:owner-amanda-us...@amanda.org] On
Behalf Of Debra S Baddorf
Sent: Tuesday, February 17, 2015 4:46 PM
To: s...@amanda.org; AMANDA users
Cc: Debra S Baddorf
Subject: Re: notify when library is running out of tapes
To take this discussion back to the whole list:
Stefan has a small untested script to make use of a feature which I
think is not active currently. He may have seen references in the code.
amadmin <config> tapes -days N
which apparently would tell you what tapes will be required for N days to come.
amadmin <config> tapes
tells about RUNTAPES number of tapes, where RUNTAPES is
the number configured to be used each day. The dash-dash-days flag
would multiply N days times RUNTAPES, I imagine.
You would still have to grep through your tape library to see if the tapes
were present.
If that -days flag worked, it could be very useful. The flags aren't
in my man pages, and they don't work for me (though nothing complains about
the flag).
Currently, one could increase the RUNTAPES parameter arbitrarily, then
amadmin <config> tapes
mtx -f /dev/changer status
and some grepping to see if all those tapes were present. But Stefan
says he needs the
RUNTAPES param and can't change it.
Or, Stefan suggests that maybe AMCHECK might be expected to do the work for
us, rather than us having to write a script to check the library.
Comments, thoughts, from anybody else? Discussion .....
Deb Baddorf
Fermilab
(please forgive capitalized words - that's so spell checker will stop changing
them into OTHER words)
On Feb 17, 2015, at 3:08 PM, Stefan G. Weichinger <s...@amanda.org> wrote:
On 17.02.2015 20:51, Debra S Baddorf wrote:
When I run it on a server with amadmin-3.3.6 .. the help tells me so, yes.
Hmmm - I'm at 3.3.7 and I don't see that.
Only for OTHER amadmin commands, such as bump.
maybe that got changed, yes!
Sophisticated users do a code-view .. others ask JLM on the list ;-)
I don't like fiddling with $runtapes, no, I need that parameter to
be exactly defined at the customer in case.
And it wouldn't be an elegant solution IMO (I wouldn't understand it
in a year and screw it up by "correcting" the value of $runtapes).
Well, if I changed it, I would put a large paragraph of comments
about WHY I had changed the value!
I prefer doing things in a way that does not bend things.
As seen above, upstream code changes ...
Maybe this makes it worth putting the amanda-users back into the email address
and sharing the concept with the list? And then re-sharing your script (since
I've
obliterated it from this email)
Feel free to share it there if you want ... I am running out of time
here right now and got to leave now. Maybe we wait with sharing it
.. ->
I'll put together both your script, and my questions about -days
and about the RUNTAPES param and post them to the list.
Just to get some conversation flowing.
Catch ya later.
Thanks, looking fwd.
To me that looks like a nice feature request for amcheck!
Stefan
diff --git a/man/xml-source/amadmin.8.xml b/man/xml-source/amadmin.8.xml
index 083ad4d..deadbeb 100644
--- a/man/xml-source/amadmin.8.xml
+++ b/man/xml-source/amadmin.8.xml
@@ -285,7 +285,7 @@ file, Amanda will treat it as a new disk during the next run.</para>
</varlistentry>
<varlistentry>
- <term><emphasis remap='B'>tape</emphasis></term>
+ <term><emphasis remap='B'>tape</emphasis> [ <option>--days</option> <replaceable><num></replaceable> ]</term>
<listitem>
<para>Display the tape(s) Amanda expects to write to during the next run.
See also
@@ -300,7 +300,7 @@ levels.</para>
</listitem>
</varlistentry>
<varlistentry>
- <term><emphasis remap='B'>balance</emphasis> [ <option>--days</option> <replaceable><num></replaceable> ]<emphasis remap='B'></emphasis> <emphasis remap='I'></emphasis> <emphasis remap='I'></emphasis></term>
+ <term><emphasis remap='B'>balance</emphasis> [ <option>--days</option> <replaceable><num></replaceable> ]</term>
<listitem>
<para>Display the distribution of full backups throughout the dump schedule.</para>
</listitem>
diff --git a/server-src/amadmin.c b/server-src/amadmin.c
index 502c412..a5bc438 100644
--- a/server-src/amadmin.c
+++ b/server-src/amadmin.c
@@ -955,8 +955,8 @@ due(
void
tape(
- int argc,
- char ** argv)
+ int argc G_GNUC_UNUSED,
+ char ** argv G_GNUC_UNUSED)
{
int nb_days = 1;
int runtapes;
@@ -965,6 +965,17 @@ tape(
int skip;
int nb_new_tape;
+ nb_days = opt_days;
+ if (opt_days == 0 || opt_days == -1) {
+ nb_days = 1;
+ }
+ if (nb_days < 1) {
+ g_printf(_("days must be an integer bigger than 0\n"));
+ return;
+ }
+ if (nb_days > 10000)
+ nb_days = 10000;
+
if(argc > 4 && strcmp(argv[3],"--days") == 0) {
nb_days = atoi(argv[4]);
if(nb_days < 1) {