From owner-freebsd-bugs Fri Mar 1 3:10:33 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 262C737B41D for ; Fri, 1 Mar 2002 03:10:02 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g21BA2i09690; Fri, 1 Mar 2002 03:10:02 -0800 (PST) (envelope-from gnats) Received: from mail016.syd.optusnet.com.au (mail016.syd.optusnet.com.au [203.2.75.176]) by hub.freebsd.org (Postfix) with ESMTP id A0DBC37B405 for ; Fri, 1 Mar 2002 03:02:43 -0800 (PST) Received: from doorway.homeip.net (c25720.sunsh1.vic.optusnet.com.au [203.164.32.100]) by mail016.syd.optusnet.com.au (8.11.1/8.11.1) with ESMTP id g21B2f606158 for ; Fri, 1 Mar 2002 22:02:42 +1100 Received: (from mark@localhost) by doorway.homeip.net (8.11.6/8.11.0) id g21B2of80344; Fri, 1 Mar 2002 22:02:50 +1100 (EST) (envelope-from mark) Message-Id: <200203011102.g21B2of80344@doorway.homeip.net> Date: Fri, 1 Mar 2002 22:02:50 +1100 (EST) From: Mark Hannon Reply-To: Mark Hannon To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: bin/35450: PATCH: Add -S flag to dump to estimate size only Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 35450 >Category: bin >Synopsis: PATCH: Add -S flag to dump to estimate size only >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Fri Mar 01 03:10:01 PST 2002 >Closed-Date: >Last-Modified: >Originator: Mark Hannon >Release: FreeBSD 4.5-RELEASE i386 >Organization: - >Environment: System: FreeBSD tbird.home.lan 4.5-RELEASE FreeBSD 4.5-RELEASE #0: Mon Jan 28 14:31:56 GMT 2002 murray@builder.freebsdmall.com:/usr/src/sys/compile/GENERIC i386 >Description: Add -S flag to dump to allow it just print out dump estimate size and then exit. Taken from NetBSD >How-To-Repeat: >Fix: Index: sbin/dump/main.c =================================================================== RCS file: /home/ncvs/src/sbin/dump/main.c,v retrieving revision 1.20.2.6 diff -c -r1.20.2.6 main.c *** sbin/dump/main.c 2001/11/24 19:19:41 1.20.2.6 --- sbin/dump/main.c 2002/02/23 02:53:24 *************** *** 105,110 **** --- 105,111 ---- register char *map; register int ch; int i, anydirskipped, bflag = 0, Tflag = 0, honorlevel = 1; + int just_estimate = 0; ino_t maxino; spcl.c_date = 0; *************** *** 124,132 **** obsolete(&argc, &argv); #ifdef KERBEROS ! #define optstring "0123456789aB:b:cd:f:h:kns:T:uWwD:" #else ! #define optstring "0123456789aB:b:cd:f:h:ns:T:uWwD:" #endif while ((ch = getopt(argc, argv, optstring)) != -1) #undef optstring --- 125,133 ---- obsolete(&argc, &argv); #ifdef KERBEROS ! #define optstring "0123456789aB:b:cd:f:h:kns:ST:uWwD:" #else ! #define optstring "0123456789aB:b:cd:f:h:ns:ST:uWwD:" #endif while ((ch = getopt(argc, argv, optstring)) != -1) #undef optstring *************** *** 187,192 **** --- 188,197 ---- tsize = numarg("tape size", 1L, 0L) * 12 * 10; break; + case 'S': /* exit after estimating # of tapes */ + just_estimate = 1; + break; + case 'T': /* time of last dump */ spcl.c_ddate = unctime(optarg); if (spcl.c_ddate < 0) { *************** *** 411,416 **** --- 416,428 ---- tapesize, fetapes); } + /* + * If the user only wants an estimate of the number of + * tapes, exit now. + */ + if (just_estimate) + exit(0); + /* * Allocate tape buffer. */ *************** *** 495,501 **** #ifdef KERBEROS "k" #endif ! "nu] [-B records] [-b blocksize] [-D dumpdates]\n" " [-d density] [-f file ] [-h level] [-s feet] " "[-T date] filesystem\n" " dump [-W | -w]\n"); --- 507,513 ---- #ifdef KERBEROS "k" #endif ! "nSu] [-B records] [-b blocksize] [-D dumpdates]\n" " [-d density] [-f file ] [-h level] [-s feet] " "[-T date] filesystem\n" " dump [-W | -w]\n"); Index: sbin/dump/dump.8 =================================================================== RCS file: /home/ncvs/src/sbin/dump/dump.8,v retrieving revision 1.27.2.9 diff -c -r1.27.2.9 dump.8 *** sbin/dump/dump.8 2001/08/16 11:35:42 1.27.2.9 --- sbin/dump/dump.8 2002/02/23 02:53:38 *************** *** 42,48 **** .Nd filesystem backup .Sh SYNOPSIS .Nm ! .Op Fl 0123456789acknu .Op Fl B Ar records .Op Fl b Ar blocksize .Op Fl D Ar dumpdates --- 42,48 ---- .Nd filesystem backup .Sh SYNOPSIS .Nm ! .Op Fl 0123456789acknSu .Op Fl B Ar records .Op Fl b Ar blocksize .Op Fl D Ar dumpdates *************** *** 194,199 **** --- 194,202 ---- prompts for a new tape. It is recommended to be a bit conservative on this option. The default tape length is 2300 feet. + .It Fl S + Display an estimate of the backup size and the number of + tapes required, and exit without actually performing the dump. .It Fl T Ar date Use the specified date as the starting time for the dump instead of the time determined from looking in >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message