Amanda-Users

Re: application/amgtar patch for review

2009-08-21 16:00:22
Subject: Re: application/amgtar patch for review
From: Christopher <chrismcc AT pricegrabber DOT com>
To: amanda users list <amanda-users AT amanda DOT org>
Date: Fri, 21 Aug 2009 12:52:46 -0700
Hello...

On Fri, 2009-08-21 at 14:59 -0400, Jean-Louis Martineau wrote:
> Patch looks good.
> 
> All code that copy/rename listed incremental files should be done only 
> if it is used.
> 

Ouch, that will take me a little longer to do.  My C skills are weak and
I need to study the logic a bit.



> If you disable --listed-incremental, you will get FULL backup at every 
> run, is it what you want?

In my case with 14M files, the choice is always full or never.  The next
filesystem I need to tackle is 2.9T with ~350M files.  I'll settle for
no incremental backups.  I also noted this in the source.



> The amgtar_support function must output "MAX-LEVEL 0" in this case.
> 

newer patch attached but without incrname part done yet.



> Jean-Louis
> 
> Christopher wrote:
> > Hello...
> >
> >     Recently I started using application-tool with amgtar to solve some
> > backup problems.  One of these problems is where several smaller
> > filesystems were merged creating a large filesystem.  The amanda backup
> > run using gtar started failing.  After much debugging I saw that the
> > gtar argument --listed-incremental /PATH was taking too long and failing
> > with:
> > dumper: [request failed: timeout waiting for REP](too)
> > df -ih shows 14M inodes used
> >
> > I switched from the standard gtar to a hacked application/amgtar with
> > these lines ripped out:
> > my_argv[i++] = "--listed-incremental";
> > my_argv[i++] = incrname;
> >
> > The backup is currently running successfully :) Attached is a patch to
> > amgtar.c adding an option to disable listed-incremental based on the
> > atime option.  I have not tested this yet as the current run will not
> > finish for another 20 hours or so.  Can someone glance at the patch to
> > see if I missed anything?
> >
> >
> >
> >
> >
> >   
> 
-- 
Christopher McCrory
 "The guy that keeps the servers running"
 
chrismcc AT pricegrabber DOT com
 http://www.pricegrabber.com
 
Let's face it, there's no Hollow Earth, no robots, and
no 'mute rays.' And even if there were, waxed paper is
no defense.  I tried it.  Only tinfoil works.

--- amanda-2.6.1p1-orig/application-src/amgtar.c        2009-04-07 
09:57:25.000000000 -0700
+++ amanda-2.6.1p1-new/application-src/amgtar.c 2009-08-21 12:21:58.573312000 
-0700
@@ -45,6 +45,8 @@
  * EXCLUDE-FILE
  * EXCLUDE-LIST
  * EXCLUDE-OPTIONAL
+ * LISTED-INCREMENTAL (default YES, If set to NO then incremental backups are
+                       impossible)
  * NORMAL
  * IGNORE
  * STRANGE
@@ -146,6 +148,7 @@
 static int gnutar_atimepreserve;
 static int gnutar_checkdevice;
 static int gnutar_sparse;
+static int gnutar_listedincremental;
 static GSList *normal_message = NULL;
 static GSList *ignore_message = NULL;
 static GSList *strange_message = NULL;
@@ -181,6 +184,7 @@
     {"exit-handling"   , 1, NULL, 26},
     {"calcsize"        , 0, NULL, 27},
     {"tar-blocksize"   , 1, NULL, 28},
+    {"listed-incremental" , 1, NULL, 29},
     {NULL, 0, NULL, 0}
 };
 
@@ -454,6 +458,9 @@
        case 27: argument.calcsize = 1;
                 break;
        case 28: argument.tar_blocksize = stralloc(optarg);
+       case 29: if (optarg && strcasecmp(optarg, "YES") != 0)
+                    gnutar_listedincremental = 0;
+                break;
        case ':':
        case '?':
                break;
@@ -518,6 +525,7 @@
     dbprintf("SPARSE %s\n", gnutar_sparse? "yes":"no");
     dbprintf("ATIME-PRESERVE %s\n", gnutar_atimepreserve? "yes":"no");
     dbprintf("CHECK-DEVICE %s\n", gnutar_checkdevice? "yes":"no");
+    dbprintf("LISTED-INCREMENTAL %s\n", gnutar_listedincremental? "yes":"no");
     {
        amregex_t *rp;
        for (rp = re_table; rp->regex != NULL; rp++) {
@@ -559,7 +567,7 @@
     fprintf(stdout, "CONFIG YES\n");
     fprintf(stdout, "HOST YES\n");
     fprintf(stdout, "DISK YES\n");
-    fprintf(stdout, "MAX-LEVEL 9\n");
+    fprintf(stdout, "MAX-LEVEL %s\n", gnutar_listedincremental? "9":"0");
     fprintf(stdout, "INDEX-LINE YES\n");
     fprintf(stdout, "INDEX-XML NO\n");
     fprintf(stdout, "MESSAGE-LINE YES\n");
@@ -1184,8 +1192,10 @@
        my_argv[i++] = "--atime-preserve=system";
     if (!gnutar_checkdevice)
        my_argv[i++] = "--no-check-device";
-    my_argv[i++] = "--listed-incremental";
-    my_argv[i++] = incrname;
+    if (gnutar_listedincremental) {
+        my_argv[i++] = "--listed-incremental";
+        my_argv[i++] = incrname;
+    }
     if (gnutar_sparse)
        my_argv[i++] = "--sparse";
     if (argument->tar_blocksize) {
<Prev in Thread] Current Thread [Next in Thread>