Nathan,

Try this patch.

run: amdump --no-dump --no-flush CONFIG
Will do all scheduled vault to the vault-storage

Jean-Louis

On 16/11/17 08:31 AM, Nathan Stratton Treadway wrote:
> On Thu, Oct 19, 2017 at 11:06:40 -0400, Jean-Louis Martineau wrote:
> > Since you want to vault all full, I would set 'vault' in the local
> > storage, set 'dump-selection' in the cloud storage, but will not set
> > 'vault-storage'
> > That way the vault are scheduled but are not executed because
> > vault-storage is not set. Amanda know they must be vaulted.
> > Every month, you can run: amdump CONF BADHOST -ovault-storage="cloud"
> > to do the vaulting.
>
> I am testing a vaulting setup where I have "vault TestOffsite 0" set on
> the main storage and a global "vault-storage TestOffsite".
>
> If the TestOffsite vtapes are not available during the nightly amdump
> run, dumps are written to the main storage and I see COPY commands queue
> up command_file for the vault storage.
>
> If I then mount the Offsite vtape partition and run an "amdump
> TestBackup BADHOST" command, the dumps are successfully copied to the
> vault, and amdump sends a report that looks like this:
>
> =====
> Hostname: backupserver
> Org : TestBackup
> Config : TestBackup
> Date : November 16, 2017
>
> The next tape Amanda expects to use is: TESTBACKUP-06.
>
>
> FAILURE DUMP SUMMARY:
> planner: FATAL no DLE to backup
>
>
> STATISTICS:
> Total Full Incr. Level:#
> -------- -------- -------- --------
> Estimate Time (hrs:min) 0:00
> Run Time (hrs:min) 0:01
> Dump Time (hrs:min) 0:00 0:00 0:00
> Output Size (meg) 0.0 0.0 0.0
> Original Size (meg) 0.0 0.0 0.0
> Avg Compressed Size (%) -- -- --
> DLEs Dumped 0 0 0
> Avg Dump Rate (k/s) -- -- --
>
> Tape Time (hrs:min) 0:00 0:00 0:00
> Tape Size (meg) 0.0 0.0 0.0
> Tape Used (%) 0.0 0.0 0.0
> DLEs Taped 0 0 0
> Parts Taped 0 0 0
> Avg Tp Write Rate (k/s) -- -- --
>
>
> USAGE BY TAPE:
> Label Time Size % DLEs Parts
> TESTBACKUP-102 0:01 7489M 3.7 9 9
>
>
> NOTES:
> planner: Argument 'BADHOST' matches neither a host nor a disk.
> driver: WARNING: got empty schedule from planner
> taper: Slot 15 with label TESTBACKUP-15 is usable
> taper: Slot 2 with label TESTBACKUP-102 is usable
> taper: tape TESTBACKUP-102 kb 7669248 fm 9 [OK]
>
>
> DUMP SUMMARY:
> DUMPER STATS TAPER STATS
> HOSTNAME DISK L ORIG-MB OUT-MB COMP% MMM:SS KB/s MMM:SS KB/s
> ----------------------- ----------------------- -------------- 
> --------------
>
> (brought to you by Amanda version 3.5)
> =====
>
>
> The main thing I notice is that nothing is listed in the Dump Summary
> section. As discussed in earlier emails, if the vault storage is
> available during the nightly amdump run, the dumps written to the vault
> show up as VAULT lines in the Dump Summary section.... so I'm wondering
> if the equivalent dumps performed during a second run should be showing
> up here in this report?
>
>
> A second thing I noticed was the three error/warning messages coming
> from the planner and driver caused by the use of "BADHOST". Unless
> those messages are actually causing the empty Dump Summary section they
> aren't a terrible problem... but especially for sites where the
> recommended configuration is to regularly run a separate vaulting run of
> amdump (such as the one discussed above), I wonder how difficult it
> would be to add support to amdump for a recognized option to turn on a
> "do pending vault operations but don't try to back up any new DLEs"
> mode?
>
> Nathan
>
> ----------------------------------------------------------------------------
> Nathan Stratton Treadway - natha...@ontko.com - Mid-Atlantic region
> Ray Ontko & Co. - Software consulting services - http://www.ontko.com/ 
> <http://www.ontko.com/>
> GPG Key: http://www.ontko.com/~nathanst/gpg_key.txt 
> <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/man/xml-source/amdump.8.xml b/man/xml-source/amdump.8.xml
index ceb12f3..42ee341 100644
--- a/man/xml-source/amdump.8.xml
+++ b/man/xml-source/amdump.8.xml
@@ -30,6 +30,9 @@
 <cmdsynopsis>
   <command>amdump</command>    
     <arg choice='opt'>--no-taper</arg>
+    <arg choice='opt'>--no-dump</arg>
+    <arg choice='opt'>--no-flush</arg>
+    <arg choice='opt'>--no-vault</arg>
     <arg choice='opt'>--exact-match</arg>
     &configoverride.synopsis;
     <arg choice='plain'><replaceable>config</replaceable></arg>
@@ -78,22 +81,51 @@ man page for more details about Amanda.</para>
 <variablelist remap='TP'>
 
   <varlistentry>
-  <term><replaceable>host</replaceable> [<replaceable>disk</replaceable>]*</term>
+  <term><option>--no-taper</option></term>
   <listitem>
-<para>Specify the host and disk on which the command will work -- see
-    the description of DLE specifications in <manref name="amanda-match" vol="7"/>. </para>
+<para>Disable writting to tape, including flush and vault.</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><option>--no-dump</option></term>
+  <listitem>
+<para>Disable dump operations.</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><option>--no-flush</option></term>
+  <listitem>
+<para>Disable flush, like setting autoflush to NO for all storages.</para>
+<para>Dump done in this run will be flushed.</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><option>--no-vault</option></term>
+  <listitem>
+<para>Disable all vault.</para>
   </listitem>
   </varlistentry>
 
   <varlistentry>
   <term><option>--exact-match</option></term>
   <listitem>
-<para>The host and disk are parsed as exact values</para>
+<para>The host and disk are parsed as exact values.</para>
   </listitem>
   </varlistentry>
 
   &configoverride.varlistentry;
 
+  <varlistentry>
+  <term><replaceable>host</replaceable> [<replaceable>disk</replaceable>]*</term>
+  <listitem>
+<para>Specify the host and disk on which the command will work -- see
+    the description of DLE specifications in <manref name="amanda-match" vol="7"/>. </para>
+  </listitem>
+  </varlistentry>
+
 </variablelist>
 </refsect1>
 
diff --git a/perl/Amanda/Amdump.pm b/perl/Amanda/Amdump.pm
index 730bbc2..919b6da 100644
--- a/perl/Amanda/Amdump.pm
+++ b/perl/Amanda/Amdump.pm
@@ -217,6 +217,9 @@ sub planner_driver_pipeline {
     my $planner = "$amlibexecdir/planner";
     my $driver = "$amlibexecdir/driver";
     my @no_taper = $self->{'no_taper'} ? ('--no-taper'):();
+    my @no_dump = $self->{'no_dump'} ? ('--no-dump'):();
+    my @no_flush = $self->{'no_flush'} ? ('--no-flush'):();
+    my @no_vault = $self->{'no_vault'} ? ('--no-vault'):();
     my @from_client = $self->{'from_client'} ? ('--from-client'):();
     my @exact_match = $self->{'exact_match'} ? ('--exact-match'):();
     my @log_filename = ('--log-filename', $self->{'trace_log_filename'});
@@ -249,10 +252,9 @@ sub planner_driver_pipeline {
 	POSIX::close($rpipe);
 	POSIX::close($wpipe);
 	POSIX::dup2(fileno($self->{'amdump_log'}), 2);
-	debug("exec: " .join(' ', $planner, $self->{'config'}, '--starttime', $self->{'timestamp'}, @log_filename, @no_taper, @from_client, @exact_match, @config_overrides, @hostdisk));
-	close($self->{'amdump_log'});
+	debug("exec: " .join(' ', $planner, $self->{'config'}, '--starttime', $self->{'timestamp'}, @log_filename, @no_taper, @no_dump, @no_flush, @no_vault, @from_client, @exact_match, @config_overrides, @hostdisk)); close($self->{'amdump_log'});
 	# note that @no_taper must follow --starttime
-	my @args = ($self->{'config'}, '--starttime', $self->{'timestamp'}, @log_filename, @no_taper, @from_client, @exact_match, @config_overrides, @hostdisk);
+	my @args = ($self->{'config'}, '--starttime', $self->{'timestamp'}, @log_filename, @no_taper, @no_dump, @no_flush, @no_vault, @from_client, @exact_match, @config_overrides, @hostdisk);
 	debug("exec $planner " . join(' ', @args));
 	exec $planner, @args;
 	die "Could not exec $planner: $!";
@@ -269,9 +271,9 @@ sub planner_driver_pipeline {
 	POSIX::dup2(fileno($self->{'amdump_log'}), 1); # driver does lots of logging to stdout..
 	POSIX::close($null);
 	POSIX::dup2(fileno($self->{'amdump_log'}), 2);
-	debug("exec: " . join(' ', $driver, $self->{'config'}, @log_filename, @no_taper, @from_client, @config_overrides));
+	debug("exec: " . join(' ', $driver, $self->{'config'}, @log_filename, @no_taper, @no_dump, @no_flush, @no_vault, @from_client, @config_overrides));
 	close($self->{'amdump_log'});
-	my @args = ($self->{'config'}, @log_filename, @no_taper, @from_client, @config_overrides);
+	my @args = ($self->{'config'}, @log_filename, @no_taper, @no_dump, @no_flush, @no_vault, @from_client, @config_overrides);
 	debug("exec $driver " . join(' ', @args));
 	exec $driver, @args;
 	die "Could not exec $driver: $!";
diff --git a/server-src/amdump.pl b/server-src/amdump.pl
index 05fece0..3efd425 100644
--- a/server-src/amdump.pl
+++ b/server-src/amdump.pl
@@ -51,6 +51,9 @@ my $config_overrides = new_config_overrides($#ARGV+1);
 my @config_overrides_opts;
 
 my $opt_no_taper = 0;
+my $opt_no_dump = 0;
+my $opt_no_flush = 0;
+my $opt_no_vault = 0;
 my $opt_from_client = 0;
 my $opt_exact_match = 0;
 
@@ -60,6 +63,9 @@ GetOptions(
     'version' => \&Amanda::Util::version_opt,
     'help|usage|?' => \&usage,
     'no-taper' => \$opt_no_taper,
+    'no-dump' => \$opt_no_dump,
+    'no-flush' => \$opt_no_flush,
+    'no-vault' => \$opt_no_vault,
     'from-client' => \$opt_from_client,
     'exact-match' => \$opt_exact_match,
     'o=s' => sub {
@@ -95,6 +101,9 @@ sub user_msg {
 my $hostdisk = \@ARGV;
 my ($amdump, @messages) = Amanda::Amdump->new(config      => $config_name,
 				 no_taper    => $opt_no_taper,
+				 no_dump     => $opt_no_dump,
+				 no_flush    => $opt_no_flush,
+				 no_vault    => $opt_no_vault,
 				 from_client => $opt_from_client,
 				 exact_match => $opt_exact_match,
 				 config_overrides => \@config_overrides_opts,
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--;
+	}
+    }
+
+    if (argc > 2) {
+	if (g_str_equal(argv[2], "--no-flush")) {
+	    //no_flush = TRUE;
+	    argv++;
+	    argc--;
+	}
+    }
+
+    if (argc > 2) {
+	if (g_str_equal(argv[2], "--no-vault")) {
+	    no_vault = TRUE;
+	    argv++;
+	    argc--;
+	}
+    }
+
+    if (argc > 2) {
 	if (g_str_equal(argv[2], "--from-client")) {
 	    //driver do nothing with --from-client
 	    argv++;
@@ -1273,6 +1301,9 @@ start_a_vault(void)
 {
     taper_t *taper;
 
+    if (no_vault)
+	return;
+
     for (taper = tapetable; taper < tapetable+nb_storage ; taper++) {
         if (taper->storage_name && taper->vault_storage) {
 	    start_a_vault_taper(taper);
@@ -4533,7 +4564,7 @@ read_schedule(
     }
     g_printf(_("driver: flush size %lld\n"), (long long)flush_size);
     amfree(inpline);
-    if(line == 0)
+    if (line == 0 && !no_dump)
 	log_add(L_WARNING, _("WARNING: got empty schedule from planner"));
     schedule_done = 1;
     start_degraded_mode(&runq);
diff --git a/server-src/planner.c b/server-src/planner.c
index a11afc9..730bd98 100644
--- a/server-src/planner.c
+++ b/server-src/planner.c
@@ -227,6 +227,9 @@ main(
     char *cfg_opt = NULL;
     int exit_status = EXIT_SUCCESS;
     gboolean no_taper = FALSE;
+    gboolean no_dump = FALSE;
+    gboolean no_flush = FALSE;
+    //gboolean no_vault = FALSE;
     gboolean from_client = FALSE;
     gboolean exact_match = FALSE;
     storage_t *storage;
@@ -323,6 +326,21 @@ main(
 	diskarg_offset += 1;
     }
     if (argc - diskarg_offset > 0 && g_str_equal(argv[diskarg_offset],
+                                                 "--no-dump")) {
+	no_dump = TRUE;
+	diskarg_offset += 1;
+    }
+    if (argc - diskarg_offset > 0 && g_str_equal(argv[diskarg_offset],
+                                                 "--no-flush")) {
+	no_flush = TRUE;
+	diskarg_offset += 1;
+    }
+    if (argc - diskarg_offset > 0 && g_str_equal(argv[diskarg_offset],
+                                                 "--no-vault")) {
+	//no_vault = TRUE;
+	diskarg_offset += 1;
+    }
+    if (argc - diskarg_offset > 0 && g_str_equal(argv[diskarg_offset],
                                                  "--from-client")) {
 	from_client = TRUE;
 	diskarg_offset += 1;
@@ -446,7 +464,7 @@ main(
 	}
     }
 
-    if (nb_disk == 0) {
+    if (nb_disk == 0 && !no_dump) {
 	if (errstr) {
 	    error(_("no DLE to backup; %s"), errstr);
 	} else {
@@ -510,7 +528,7 @@ main(
 
     g_fprintf(stderr,_("\nSENDING FLUSHES...\n"));
 
-    if (!no_taper) {
+    if (!no_taper && !no_flush) {
 	dumpfile_t  file;
 	GSList *holding_list, *holding_file;
 	char *qdisk, *qhname;
@@ -623,6 +641,7 @@ main(
      * based on the curinfo database.
      */
 
+  if (!no_dump) {
     g_fprintf(stderr,_("\nSETTING UP FOR ESTIMATES...\n"));
     section_start = curclock();
 
@@ -803,6 +822,7 @@ main(
         while(!empty(schedq)) output_scheduleline(dequeue_est(&schedq));
     }
     g_fprintf(stderr, _("--------\n"));
+  }
 
     close_infofile();
     log_add(L_FINISH, _("date %s time %s"), planner_timestamp, walltime_str(curclock()));

Reply via email to