NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/54469: Add -D flag to dump(8)



>Number:         54469
>Category:       bin
>Synopsis:       Add -D flag to dump(8)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Thu Aug 15 19:50:00 +0000 2019
>Originator:     Konrad Schroder
>Release:        Through 20190815 current
>Organization:
University of Washington
>Environment:
NetBSD apu1c.bastion.coral.washington.edu 9.99.7 NetBSD 9.99.7 (APU1C_GENERIC) #13: Thu Aug 15 12:14:59 PDT 2019  root%backup.coral.washington.edu@localhost:/ovar/src-current/sys/arch/amd64/compile/obj/APU1C_GENERIC amd64

>Description:
In (at least) FreeBSD and Linux, dump(8) has a flag -D which allows the user to specify a dumpdates file other than /etc/dumpdates.  This could be useful for user-mounted media if the user does not have permission to write to /etc/dumpdates; or for keeping multiple independent backup sets.

The patch is straightforward.  If there are no objections I'll commit it in a few days.
>How-To-Repeat:
# dump -D mydumpdatesfile -0 -f- /
dump: unknown option -- D
usage: dump [-0123456789aceFinStuX] [-B records] [-b blocksize]
            [-d density] [-f file] [-h level] [-k read-blocksize]
            [-L label] [-l timeout] [-r cachesize] [-s feet]
            [-T date] [-x snap-backup] files-to-dump
       dump [-W | -w]

>Fix:
Index: sbin/dump/dump.8
===================================================================
RCS file: /cvsroot/src/sbin/dump/dump.8,v
retrieving revision 1.71
diff -u -r1.71 dump.8
--- sbin/dump/dump.8    25 Mar 2019 07:03:17 -0000      1.71
+++ sbin/dump/dump.8    15 Aug 2019 19:44:46 -0000
@@ -42,6 +42,7 @@
 .Op Fl 0123456789aceFinStuX
 .Op Fl B Ar records
 .Op Fl b Ar blocksize
+.Op Fl D Ar dumpdates-file
 .Op Fl d Ar density
 .Op Fl f Ar file
 .Op Fl h Ar level
@@ -145,6 +146,9 @@
 .It Fl c
 Modify the calculation of the default density and tape size to be more
 appropriate for cartridge tapes.
+.It Fl D Ar dumpdates-file
+Use the given file as a record of dump dates instead of
+.Pa /etc/dumpdates .
 .It Fl d Ar density
 Set tape density to
 .Ar density .
Index: sbin/dump/main.c
===================================================================
RCS file: /cvsroot/src/sbin/dump/main.c,v
retrieving revision 1.75
diff -u -r1.75 main.c
--- sbin/dump/main.c    25 Mar 2019 02:13:01 -0000      1.75
+++ sbin/dump/main.c    15 Aug 2019 19:44:46 -0000
@@ -133,7 +133,7 @@

        obsolete(&argc, &argv);
        while ((ch = getopt(argc, argv,
-           "0123456789aB:b:cd:eFf:h:ik:l:L:nr:s:StT:uU:Wwx:X")) != -1)
+           "0123456789aB:b:cd:D:eFf:h:ik:l:L:nr:s:StT:uU:Wwx:X")) != -1)
                switch (ch) {
                /* dump level */
                case '0': case '1': case '2': case '3': case '4':
@@ -164,6 +164,10 @@
                                ntrec = HIGHDENSITYTREC;
                        break;

+               case 'D':               /* specify alt. dumpdates file */
+                       dumpdates = optarg;
+                       break;
+
                case 'e':               /* eject full tapes */
                        eflag = 1;
                        break;



Home | Main Index | Thread Index | Old Index