Current-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
dump(8) lacks a last-stage incremental dump feature
Greetings, I'm not sure whither to send this.
Once upon a time I bemoaned that dump(8) lacked the ability to do a
"true incremental dump" once level 9 was reached. You can start
at 0 (full) and then just do 1..9 and have incremental backups, but
the next 9 will be a differential.
There are two solutions to this:
1) modify /etc/dumpdates after the level 9 so that it becomes a level 8,
and delete the previous level 8 dump. Your next level 9 will be a level 8.
2) modify dump(8) for an extra flag to do a "true incremental". Solstice
Backup, back in the day, used levels 0..9 and 'x' for the "true
incremental".
Solution 1 seems gross.
Solution 2 seems workable...I have some patches handy, NOTING, of course
that 'x' for our dump means "snapshot", and "X" is similarly used.
I opted for 'i', for "incremental".
Granted that dump(8) is antiquated, but I still use it as my main means of
backing up filesystems because a) it is present, b) it is simple and c)
it is efficient as it understands the ffs layout.
I think I patched this up as well as can be expected, considering the
program flow in itime.c.
Please forgive me if this went to the wrong spot.
I hope others will find this useful.
Patches:
# for f in dump.h itime.c main.c; do diff -wbu $f $f.orig; done
--- dump.h.orig 2010-02-24 00:26:52.000000000 -0800
+++ dump.h 2010-02-24 00:26:56.000000000 -0800
@@ -110,6 +110,7 @@
int diskfd; /* disk file descriptor */
int tapefd; /* tape file descriptor */
int pipeout; /* true => output to standard output */
+int trueinc; /* true => "true incremental", i.e use last 9 as ref */
ino_t curino; /* current inumber; used globally */
int newtape; /* new tape flag */
u_int64_t tapesize; /* estimated tape size, blocks */
--- itime.c.orig 2010-02-24 00:28:59.000000000 -0800
+++ itime.c 2010-02-24 01:23:42.000000000 -0800
@@ -145,12 +145,14 @@
initdumptimes();
/*
* Go find the entry with the same name for a lower increment
- * and older date
+ * and older date. If we are doing a true incremental, then
+ * we can use level 9 as a ref point.
*/
ITITERATE(i, ddp) {
if (strncmp(fname, ddp->dd_name, sizeof (ddp->dd_name)) != 0)
continue;
- if (ddp->dd_level >= level)
+ if ((!trueinc && (ddp->dd_level >= level)) ||
+ (trueinc && (ddp->dd_level > level)))
continue;
if (ddp->dd_ddate <= iswap32(spcl.c_ddate))
continue;
--- main.c.orig 2010-02-24 00:16:39.000000000 -0800
+++ main.c 2010-02-24 01:50:29.000000000 -0800
@@ -134,7 +134,7 @@
obsolete(&argc, &argv);
while ((ch = getopt(argc, argv,
- "0123456789aB:b:cd:eFf:h:k:l:L:nr:s:StT:uWwx:X")) != -1)
+ "0123456789iaB:b:cd:eFf:h:k:l:L:nr:s:StT:uWwx:X")) != -1)
switch (ch) {
/* dump level */
case '0': case '1': case '2': case '3': case '4':
@@ -142,6 +142,11 @@
level = ch;
break;
+ case 'i': /* "true incremental" regardless level 9 */
+ level = '9';
+ trueinc = 1;
+ break;
+
case 'a': /* `auto-size', Write to EOM. */
unlimited = 1;
break;
--
<center>--*greywolf;<br>
/* relayer @t gmail d0t com */
/* ^ spam decoy ^ */
Home |
Main Index |
Thread Index |
Old Index