From 0de2ad0a86685398621fb8ffa6990c029681bb3a Mon Sep 17 00:00:00 2001 From: Bdale Garbee Date: Mon, 19 May 2008 22:46:39 -0600 Subject: [PATCH] Imported Upstream version 2.4.5 --- AUTHORS | 4 +- ChangeLog | 548 +++++++- Makefile.in | 2 +- NEWS | 21 + acinclude.m4 | 28 +- amplot/amplot.awk | 5 +- changer-src/chg-multi.sh.in | 5 + changer-src/chg-zd-mtx.sh.in | 92 +- changer-src/scsi-cam.c | 4 +- client-src/amandad.c | 53 +- client-src/amqde.c | 4 +- client-src/calcsize.c | 266 ++-- client-src/selfcheck.c | 88 +- client-src/sendbackup-gnutar.c | 36 +- client-src/sendsize.c | 151 ++- common-src/alloc.c | 5 +- common-src/amanda.h | 42 +- common-src/amfeatures.c | 6 +- common-src/amfeatures.h | 6 +- common-src/match.c | 107 +- common-src/protocol.c | 36 +- common-src/protocol.h | 4 +- common-src/security.c | 2 +- common-src/sl.c | 2 +- common-src/sl.h | 2 +- common-src/version.c | 12 +- common-src/versuff.c | 4 +- config/acinclude.m4i | 28 +- config/config.h.in | 3 + config/install-sh | 496 ++++---- configure | 253 +++- configure.in | 16 +- docs/DUMPER-API | 392 ------ docs/EXCLUDE | 317 ----- docs/FAQ | 525 -------- docs/HOWTO-AFS | 8 - docs/HOWTO-CYGWIN.html | 240 ---- docs/HOWTO-FILE-DRIVER | 356 ------ docs/INDEXING | 383 ------ docs/INSTALL | 380 ------ docs/INTERNALS | 271 ---- docs/KERBEROS | 76 -- docs/LABEL.PRINTING | 51 - docs/MULTITAPE | 136 -- docs/Makefile.am | 98 +- docs/Makefile.in | 100 +- docs/PORT.USAGE | 201 --- docs/RAIT | 109 -- docs/RESTORE | 193 --- docs/SAMBA | 177 --- docs/SECURITY | 48 - docs/SYSTEM.NOTES | 305 ----- docs/TAPE.CHANGERS | 791 ------------ docs/TAPETYPES | 32 - docs/UPGRADE | 60 - docs/VTAPE-API | 49 - docs/WHATS.NEW | 392 ------ docs/WISHLIST | 163 --- docs/YEAR2000 | 5 - docs/ZFTAPE | 82 -- docs/amadmin.8.txt | 220 ++++ docs/amanda.8.txt | 1182 ++++++++++++++++++ docs/amcheck.8.txt | 367 ++++++ docs/amcheckdb.8.txt | 49 + docs/amcleanup.8.txt | 54 + docs/amdd.8.txt | 85 ++ docs/amdump.8.txt | 67 + docs/amflush.8.txt | 93 ++ docs/amgetconf.8.txt | 72 ++ docs/amlabel.8.txt | 92 ++ docs/ammt.8.txt | 118 ++ docs/amoverview.8.txt | 87 ++ docs/amplot.8.txt | 99 ++ docs/amrecover.8.txt | 353 ++++++ docs/amreport.8.txt | 84 ++ docs/amrestore.8.txt | 145 +++ docs/amrmtape.8.txt | 62 + docs/amstatus.8.txt | 80 ++ docs/amtape.8.txt | 114 ++ docs/amtapetype.8.txt | 100 ++ docs/amtoc.8.txt | 98 ++ docs/amverify.8.txt | 47 + docs/amverifyrun.8.txt | 27 + docs/chg-scsi.notes | 343 ----- docs/chgscsi.txt | 266 ++++ docs/dumperapi.txt | 325 +++++ docs/eventapi.txt | 167 +++ docs/exclude.txt | 338 +++++ docs/faq.txt | 543 ++++++++ docs/historical.txt | 138 +++ docs/howto-afs.txt | 35 + docs/howto-cygwin.txt | 261 ++++ docs/howto-filedriver.txt | 434 +++++++ docs/howtos.txt | 71 ++ docs/index.txt | 831 +++++++++++++ docs/indexing.txt | 370 ++++++ docs/install.txt | 369 ++++++ docs/internals.txt | 181 +++ docs/introduction.txt | 150 +++ docs/ix01.txt | 88 ++ docs/kerberos.txt | 253 ++++ docs/labelprinting.txt | 81 ++ docs/links.txt | 33 + docs/manpages.txt | 68 + docs/multitape.txt | 182 +++ docs/portusage.txt | 206 +++ docs/pr01.txt | 38 + docs/pr02.txt | 13 + docs/pr03.txt | 27 + docs/pr04.txt | 171 +++ docs/rait.txt | 104 ++ docs/references.txt | 22 + docs/restore.txt | 201 +++ docs/samba.txt | 188 +++ docs/security-api.txt | 447 +++++++ docs/security.txt | 79 ++ docs/strategy-api.txt | 65 + docs/survey.txt | 623 ++++++++++ docs/systemnotes.txt | 325 +++++ docs/tapechangers.txt | 676 ++++++++++ docs/tapesnchangers.txt | 112 ++ docs/tapetypes.txt | 48 + docs/technical.txt | 217 ++++ docs/topten.txt | 431 +++++++ docs/upgrade.txt | 68 + docs/using.txt | 1983 +++++++++++++++++++++++++++++ docs/various.txt | 209 ++++ docs/vtape-api.txt | 65 + docs/whatwasnew.txt | 468 +++++++ docs/wishlist.txt | 274 ++++ docs/y2k.txt | 34 + docs/zftape.txt | 109 ++ example/3hole.ps | 9 + example/amanda.conf.in | 23 +- man/Makefile.am | 2 +- man/Makefile.in | 54 +- man/amadmin.8 | 239 ++++ man/amadmin.8.in | 363 ------ man/amanda.8 | 1204 ++++++++++++++++++ man/amanda.8.in | 2131 -------------------------------- man/amcheck.8 | 393 ++++++ man/amcheck.8.in | 628 ---------- man/amcheckdb.8 | 70 ++ man/amcheckdb.8.in | 54 - man/amcleanup.8 | 74 ++ man/amcleanup.8.in | 73 -- man/amdd.8 | 209 ++-- man/amdump.8 | 79 ++ man/amdump.8.in | 97 -- man/amflush.8 | 100 ++ man/amflush.8.in | 141 --- man/amgetconf.8 | 104 ++ man/amgetconf.8.in | 120 -- man/amlabel.8 | 105 ++ man/amlabel.8.in | 143 --- man/ammt.8 | 248 ++-- man/amoverview.8 | 97 ++ man/amoverview.8.in | 112 -- man/amplot.8 | 276 ++--- man/amrecover.8 | 378 ++++++ man/amrecover.8.in | 487 -------- man/amreport.8 | 98 ++ man/amreport.8.in | 131 -- man/amrestore.8 | 455 +++---- man/amrmtape.8 | 78 ++ man/amrmtape.8.in | 73 -- man/amstatus.8 | 100 ++ man/amstatus.8.in | 104 -- man/amtape.8 | 264 ++-- man/amtapetype.8 | 113 ++ man/amtapetype.8.in | 104 -- man/amtoc.8 | 131 ++ man/amtoc.8.in | 128 -- man/amverify.8 | 63 + man/amverify.8.in | 71 -- man/amverifyrun.8 | 40 + man/amverifyrun.8.in | 17 - recover-src/set_commands.c | 2 +- recover-src/uparse.c | 1503 ++++++++++++---------- recover-src/uparse.h | 135 +- recover-src/uscan.c | 2 +- recover-src/uscan.l | 2 +- restore-src/amrestore.c | 41 +- server-src/amadmin.c | 197 ++- server-src/amcheck.c | 96 +- server-src/amdump.sh.in | 17 +- server-src/amflush.c | 9 +- server-src/amindexd.c | 4 +- server-src/amoverview.pl.in | 27 +- server-src/amrmtape.sh.in | 4 + server-src/amstatus.pl.in | 242 +++- server-src/amtrmidx.c | 2 +- server-src/amverify.sh.in | 21 +- server-src/amverifyrun.sh.in | 10 +- server-src/conffile.c | 206 ++- server-src/conffile.h | 22 +- server-src/diskfile.c | 43 +- server-src/diskfile.h | 27 +- server-src/driver.c | 109 +- server-src/driverio.c | 26 +- server-src/dumper.c | 18 +- server-src/find.c | 21 +- server-src/find.h | 1 + server-src/holding.c | 47 +- server-src/infofile.c | 87 +- server-src/infofile.h | 12 +- server-src/planner.c | 710 +++++++---- server-src/reporter.c | 84 +- server-src/taper.c | 2 +- tape-src/tapetype.c | 54 +- 210 files changed, 24730 insertions(+), 13732 deletions(-) delete mode 100644 docs/DUMPER-API delete mode 100644 docs/EXCLUDE delete mode 100644 docs/FAQ delete mode 100644 docs/HOWTO-AFS delete mode 100644 docs/HOWTO-CYGWIN.html delete mode 100644 docs/HOWTO-FILE-DRIVER delete mode 100644 docs/INDEXING delete mode 100644 docs/INSTALL delete mode 100644 docs/INTERNALS delete mode 100644 docs/KERBEROS delete mode 100644 docs/LABEL.PRINTING delete mode 100644 docs/MULTITAPE delete mode 100644 docs/PORT.USAGE delete mode 100644 docs/RAIT delete mode 100644 docs/RESTORE delete mode 100644 docs/SAMBA delete mode 100644 docs/SECURITY delete mode 100644 docs/SYSTEM.NOTES delete mode 100644 docs/TAPE.CHANGERS delete mode 100644 docs/TAPETYPES delete mode 100644 docs/UPGRADE delete mode 100644 docs/VTAPE-API delete mode 100644 docs/WHATS.NEW delete mode 100644 docs/WISHLIST delete mode 100644 docs/YEAR2000 delete mode 100644 docs/ZFTAPE create mode 100644 docs/amadmin.8.txt create mode 100644 docs/amanda.8.txt create mode 100644 docs/amcheck.8.txt create mode 100644 docs/amcheckdb.8.txt create mode 100644 docs/amcleanup.8.txt create mode 100644 docs/amdd.8.txt create mode 100644 docs/amdump.8.txt create mode 100644 docs/amflush.8.txt create mode 100644 docs/amgetconf.8.txt create mode 100644 docs/amlabel.8.txt create mode 100644 docs/ammt.8.txt create mode 100644 docs/amoverview.8.txt create mode 100644 docs/amplot.8.txt create mode 100644 docs/amrecover.8.txt create mode 100644 docs/amreport.8.txt create mode 100644 docs/amrestore.8.txt create mode 100644 docs/amrmtape.8.txt create mode 100644 docs/amstatus.8.txt create mode 100644 docs/amtape.8.txt create mode 100644 docs/amtapetype.8.txt create mode 100644 docs/amtoc.8.txt create mode 100644 docs/amverify.8.txt create mode 100644 docs/amverifyrun.8.txt delete mode 100644 docs/chg-scsi.notes create mode 100644 docs/chgscsi.txt create mode 100644 docs/dumperapi.txt create mode 100644 docs/eventapi.txt create mode 100644 docs/exclude.txt create mode 100644 docs/faq.txt create mode 100644 docs/historical.txt create mode 100644 docs/howto-afs.txt create mode 100644 docs/howto-cygwin.txt create mode 100644 docs/howto-filedriver.txt create mode 100644 docs/howtos.txt create mode 100644 docs/index.txt create mode 100644 docs/indexing.txt create mode 100644 docs/install.txt create mode 100644 docs/internals.txt create mode 100644 docs/introduction.txt create mode 100644 docs/ix01.txt create mode 100644 docs/kerberos.txt create mode 100644 docs/labelprinting.txt create mode 100644 docs/links.txt create mode 100644 docs/manpages.txt create mode 100644 docs/multitape.txt create mode 100644 docs/portusage.txt create mode 100644 docs/pr01.txt create mode 100644 docs/pr02.txt create mode 100644 docs/pr03.txt create mode 100644 docs/pr04.txt create mode 100644 docs/rait.txt create mode 100644 docs/references.txt create mode 100644 docs/restore.txt create mode 100644 docs/samba.txt create mode 100644 docs/security-api.txt create mode 100644 docs/security.txt create mode 100644 docs/strategy-api.txt create mode 100644 docs/survey.txt create mode 100644 docs/systemnotes.txt create mode 100644 docs/tapechangers.txt create mode 100644 docs/tapesnchangers.txt create mode 100644 docs/tapetypes.txt create mode 100644 docs/technical.txt create mode 100644 docs/topten.txt create mode 100644 docs/upgrade.txt create mode 100644 docs/using.txt create mode 100644 docs/various.txt create mode 100644 docs/vtape-api.txt create mode 100644 docs/whatwasnew.txt create mode 100644 docs/wishlist.txt create mode 100644 docs/y2k.txt create mode 100644 docs/zftape.txt create mode 100644 man/amadmin.8 delete mode 100644 man/amadmin.8.in create mode 100644 man/amanda.8 delete mode 100644 man/amanda.8.in create mode 100644 man/amcheck.8 delete mode 100644 man/amcheck.8.in create mode 100644 man/amcheckdb.8 delete mode 100644 man/amcheckdb.8.in create mode 100644 man/amcleanup.8 delete mode 100644 man/amcleanup.8.in create mode 100644 man/amdump.8 delete mode 100644 man/amdump.8.in create mode 100644 man/amflush.8 delete mode 100644 man/amflush.8.in create mode 100644 man/amgetconf.8 delete mode 100644 man/amgetconf.8.in create mode 100644 man/amlabel.8 delete mode 100644 man/amlabel.8.in create mode 100644 man/amoverview.8 delete mode 100644 man/amoverview.8.in create mode 100644 man/amrecover.8 delete mode 100644 man/amrecover.8.in create mode 100644 man/amreport.8 delete mode 100644 man/amreport.8.in create mode 100644 man/amrmtape.8 delete mode 100644 man/amrmtape.8.in create mode 100644 man/amstatus.8 delete mode 100644 man/amstatus.8.in create mode 100644 man/amtapetype.8 delete mode 100644 man/amtapetype.8.in create mode 100644 man/amtoc.8 delete mode 100644 man/amtoc.8.in create mode 100644 man/amverify.8 delete mode 100644 man/amverify.8.in create mode 100644 man/amverifyrun.8 delete mode 100644 man/amverifyrun.8.in diff --git a/AUTHORS b/AUTHORS index 8c8dd4b..503d58a 100644 --- a/AUTHORS +++ b/AUTHORS @@ -40,9 +40,7 @@ and supporter - Jon LaBadie : active supporter -- Stefan G. Weichinger : documentation, author of - file:driver - +- Stefan G. Weichinger : documentation, active supporter Many other people have contributed to the development of Amanda; check the ChangeLog for their names and e-mail addresses. diff --git a/ChangeLog b/ChangeLog index 95f93e7..3e4b05f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,14 +1,444 @@ -2004-06-22 Jean-Louis Martineau +2005-04-20 Jean-Louis Martineau - * Amanda 2.4.4p3 released. - * configure.in: AM_INIT_AUTOMAKE(amanda, 2.4.4p3). - * News: Changes in release 2.4.4p3. + * Amanda 2.4.5 released. + * configure.in: AM_INIT_AUTOMAKE(amanda, 2.4.5). + * NEWS: Update for 2.4.5. + +2005-04-20 Jean-Louis Martineau + + * docs/*: Update from latest xml-docs. + +2005-04-15 Jean-Louis Martineau + + * docs/*: Update from latest xml-docs. + +2005-04-14 Jean-Louis Martineau + + * changer-src/chg-zd-mtx.sh.in: Improve handling of + "Unknown Storage Element Loaded". + +2005-04-14 Jean-Louis Martineau + + * man/amcheckdb.8: Update from latest xml-docs. + +2005-04-14 Jean-Louis Martineau + + * docs/*: New documentation from xml-docs. + * docs/Makefile.am (pkgdata_DATA): Update for new files. + +2005-04-06 Jean-Louis Martineau + - https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=144052 + + * server-src/amverifyrun.sh.in: Filter changer log file. + +2005-04-06 Jean-Louis Martineau + + * server-src/amcheck.c: Improve messages. + +2005-04-06 Jean-Louis Martineau + + * client-src/sendsize.c (generic_calc_estimates): Use amname instead + of dirname in message. + +2005-04-01 Jean-Louis Martineau + + * man/amanda.8, man/amdd.8, man/ammt.8: Updated. + +2005-03-31 Jean-Louis Martineau + + * man/Makefile.am (EXTRA_DIST): Add amadmin.8 amanda.8 amcheck.8 + amcheckdb.8 amcleanup.8 amdump.8 amflush.8 amgetconf.8 amlabel.8 + amoverview.8 amreport.8 amrecover.8 amrmtape.8 amstatus.8 + amtapetype.8 amtoc.8 amverify.8 amverifyrun.8 + +2005-03-31 Jean-Louis Martineau + + * man/*: use man pages form xml-docs. + * configure.in (AC_CONFIG_FILES): Remove all man pages. + +2005-03-31 Jean-Louis Martineau + + * server-src/dumper.c (update_dataptr): Open a new chunk file even if + size==0, the test must be (dataout < datain), which means we have + something to write. + +2005-03-29 Jean-Louis Martineau + + * NEWS: new amoverview -skipmissed option. + +2005-03-29 Jean-Louis Martineau + + * server-src/conffile.h: Rename getcont_unit_divisor to + getconf_unit_divisor. + * server-src/amadmin.c: Use getconf_unit_divisor. + * server-src/amcheck.c: Use getconf_unit_divisor. + * server-src/conffile.c: Use getconf_unit_divisor. + * server-src/conffile.c (unit_divisor): Init to 1. + * server-src/reporter.c: Use getconf_unit_divisor. The mb macro always + divide by 1024. Add the du macro. Use mb or du where appropriate. + +2005-03-16 Jean-Louis Martineau + + * server-src/infofile.h (history_t): Add secs field. + * server-src/infofile.c (read_txinfofile): Parse info file with secs + in history. + * server-src/infofile.c (write_txinfofile): Write secs in history. + * server-src/driverio.c (update_info_dumper): Update secs in history. + +2005-03-16 Jean-Louis Martineau + + * server-src/planner.c: Improve server estimate. + * server-src/planner.c: Write server estimate like others estimate. + +2005-02-14 Jean-Louis Martineau + + * server-src/amstatus.pl.in: last_level is negative, on new disk. + +2005-02-09 Jean-Louis Martineau + + * server-src/amstatus.pl.in: Use '-?' to match negative values + instead of '-*'. + +2005-02-09 Jean-Louis Martineau + Patch by Orion Poplawski + + * server-src/amoverview.pl.in: Print the total number of level 0 + dumps for each disk and the number of runs until the last level 0 + dump will be overwritten. + +2005-02-09 Jean-Louis Martineau + Patch by Phil Homewood + + * server-src/amoverview.pl.in: Add -skipmissed option. + +2005-02-09 Jean-Louis Martineau + + * server-src/driver.c: Print the chunksize to the log. + +2005-02-09 Jean-Louis Martineau + + * client-src/calcsize.c: Print estimate to STDERR. + * client-src/sendsize.c (generic_calc_estimates): Read calcsize result, + and send it to amandad. Write debuging message. + +2005-02-09 Jean-Louis Martineau + Patch by Franz G. Fischer + + * server-src/conffile.c: Adds a value type LONG and a val_t.l long + union member and changes get_number() to return long and + get_simple() to fill val_t.l if called for a long value. The + get_simple() calls have been changed to LONG for typetype_t.blocksize + typetype_t.length, typetype_t.filemark, holdingdisk_t.disksize and + holdingdisk_t.chunksize. + +2005-02-09 Jean-Louis Martineau + + * server-src/amdump.sh.in: Redirect in append mode. + * server-src/driver.c: Set stdout and stderr to not buffered. + * server-src/planner.c: Set stderr to not buffered. + Print 'setup_estimate:' on one line. + * server-src/amstatus.pl.in: Parse new 'setup_estimate:' line. + +2005-02-09 Jean-Louis Martineau + + * client-src/calcsize.c: Improve estimate for sparse file and count + space for filenames. + +2005-02-09 Jean-Louis Martineau + + * server-src/planner.c: Improve message if no incremental estimate. + +2005-01-23 Stefan G. Weichinger + Patch by Jon LaBadie + + * changer-src/chg-multi.sh.in: New header to explain the meaning of + the "multi" in "chg-multi". + +2004-12-21 Jean-Louis Martineau + Patch by Christopher Pascoe + + * common-src/match.c (match_glob, match_tar): Don't amfree(regex) + before calling error(). + +2004-11-22 Jean-Louis Martineau + + * server-src/driver.c (startaflush): Use ALGO_SMALLEST if nothing fit. + +2004-11-22 Jean-Louis Martineau + + * server-src/driver.c: Typo. + +2004-11-19 Jean-Louis Martineau + + * restore-src/amrestore.c: Should now work correctly with empty file. + * server-src/amverify.sh.in: Parse "End-of-Information detected." + message from amrestore. + +2004-11-19 Jean-Louis Martineau + + * server-src/driver.c: tape_left should not become negative. + +2004-11-19 Jean-Louis Martineau + Patch by Orion Poplawski + + * server-src/diskfile.c: Parse negative spindle (-1). + +2004-11-19 Jean-Louis Martineau + + * server-src/amadmin.c: Balance subcommand use displayunit. + * server-src/amcheck.c: Small cleanup. + +2004-11-19 Jean-Louis Martineau + + * restore-src/amrestore.c: Undo patch from 2004-11-11, it break + the file: dirver. + +2004-11-19 Jean-Louis Martineau + + * server-src/amstatus.pl.in: Remove trace. + +2004-11-16 Jean-Louis Martineau + + * NEWS: new displayunit global option to select the unit use to + display number: k=kilo, m=mega, g=giga, t=tera + * server-src/conffile.c: Parse displayunit, + new fonction getcont_unit_divisor(). + * server-src/conffile.h: Prototype of getcont_unit_divisor(). + * server-src/amcheck.c: Use displayunit to display holding disk size. + * server-src/amstatus.pl.in: Use displayunit to display dump size. + * server-src/reporter.c: use displayunit to display dump size. + * man/amanda.8.in: Document displayunit. + +2004-11-16 Jean-Louis Martineau + + * server-src/reporter.c: Change 'Daily' for 'Incr.'. + +2004-11-15 Jean-Louis Martineau + + * server-src/amstatus.pl.in Fix for level -1. + +2004-11-15 Jean-Louis Martineau + Patch by Daniel Widyono + + * changer-src/chg-zd-mtx.sh.in: Fix for library with barcode. + + +2004-11-11 Jean-Louis Martineau + + * server-src/planner.c: Print the time in the FINISH line. + * server-src/reporter.c: The estimate time is based on the planner + FINISH line. + +2004-11-11 Jean-Louis Martineau + + * restore-src/amrestore.c: Read empty file. + +2004-11-10 Jean-Louis Martineau + + * server-src/driver.c (selectset): Make only one declaration in main. + +2004-11-10 Jean-Louis Martineau + + * tape-src/tapetype.c: Use new tape. + +2004-11-08 Jean-Louis Martineau + + * server-src/amstatus.pl.in: Display partial estimate. + +2004-11-08 Jean-Louis Martineau + Patch by Orion Poplawski + + * server-src/amstatus.pl.in: a FLUSH command can't be in an estimate + phase. + * server-src/driver.c: Start autoflush while waiting for estimate. + * server-src/planner.c: Write FLUSH line before estimate. + +2004-11-08 Jean-Louis Martineau + + * server-src/diskfile.c (read_diskline): A spindle must be numerical. + +2004-10-22 Jean-Louis Martineau + + * Amanda 2.4.5b1 released. + +2004-10-21 Jean-Louis Martineau + + * server-src/holding.c (rename_tmp_holding): Always rename files. + +2004-10-21 Jean-Louis Martineau + + * server-src/driver.c: Print message when too many retry. + * server-src/amstatus.pl.in: Detect a failed dump after too many retry. + * amplot/amplot.awk: Parse these message. + +2004-10-21 Jean-Louis Martineau + + * server-src/driver.c (dump_to_tape): Don't retry a dump indefinitely + if dumper returns DONE and taper returns TRYAGAIN. + +2004-10-21 Jean-Louis Martineau + + * server-src/driver.c (dump_to_tape): Don't retry a dump indefinitely + if dumper returns TRYAGAIN and taper returns DONE. + +2004-10-20 Jean-Louis Martineau + + * server-src/amflush.c: Don't start a driver if nothing to flush. + +2004-10-14 Jean-Louis Martineau + Patch by Eric Siegerman + + * example/3hole.ps: Fix for multiple tape. + +2004-10-04 Jean-Louis Martineau + + * server-src/amverify.sh.in: Terminate if no tape online. + +2004-09-17 Jean-Louis Martineau + + * server-src/amadmin.c (main): Call check_dumpuser() as soon as posible. + +2004-09-17 Jean-Louis Martineau + + * server-src/conffile.c (getconf_byname): Special case for typ == BOOL. + +2004-09-17 Jean-Louis Martineau + + * server-src/planner.c (promote_hills): Use dumpcycle instead of + tapecycle. + * example/amanda.conf.in: Remove warning for tapecyle set to inf. + +2004-09-17 Jean-Louis Martineau + + * server-src/amadmin.c (balance): Don't core dump if DUMPCYLE is too + big. + +2004-09-15 Jean-Louis Martineau + + * tape-src/tapetype.c: New -o option, doesn't overwrite amanda + tape without -o. + * man/amtapetype.8.in: Document new -o option. + +2004-09-15 Jean-Louis Martineau + + * server-src/amstatus.pl.in: Works with failed dump to tape. + +2004-08-31 Jean-Louis Martineau + + * client-src/sendbackup-gnutar.c (end_backup): Write warning message + in not fatal error. + * server-src/dumper.c (process_dumpline): Parse warning message. + * server-src/reporter.c (handle_strange): Print warning message in + the STRANGE summary. + +2004-08-31 Jean-Louis Martineau + + * server-src/driverio.c (free_serial): Set stable[s].dp to NULL. + * server-src/driverio.c (disk2serial): Check that stable[s].dp == NULL. + +2004-08-31 Jean-Louis Martineau + Patch by Joe Rhett + + * common-src/alloc.c (safe_env): Keep SYSTEMROOT if __CYGWIN__. + +2004-08-31 Jean-Louis Martineau + Patch by Orion Poplawski + + * server-src/conffile.c (copy_dumptype): Copy maxpromoteday. + +2004-08-12 Jean-Louis Martineau + + * client-src/selfcheck.c (check_disk): More check for CALCSIZE. + +2004-08-11 Jean-Louis Martineau + + * common-src/amfeatures.h (fe_selfcheck_calcsize): New feature. + * common-src/amfeatures.c (am_init_feature_set): Set + fe_selfcheck_calcsize. + * client-src/selfcheck.c: Check if calcsize binary is available if + it is needed. + * server-src/amcheck.c (start_host): Call selfcheck with CALCSIZE + if it support fe_selfcheck_calcsize. + +2004-08-05 Jean-Louis Martineau + + * man/amanda.8.in: Document 'estimate' dumptype option. + +2004-08-05 Jean-Louis Martineau + + * client-src/amqde.c: Change snprintf for ap_snprintf. + +2004-08-04 Jean-Louis Martineau + + * server-src/amrmtape.sh.in: Understand history info. + +2004-08-03 Jean-Louis Martineau + + * server-src/amstatus.pl.in: Parse CONTINUE and RQ-MORE-DISK line, + print if a dump is waiting for holding disk space (roomq). + +2004-08-03 Jean-Louis Martineau + + * server-src/driverio.c (dumper_cmd): Print serial number for CONTINUE + command. + * server-src/driverio.c (disk2serial): Try to find a 'dp' before + allocating a new serial. + * server-src/dumper.c (update_dataptr): Read serial number for CONTINUE + command. + +2004-08-03 Jean-Louis Martineau + + * server-src/planner.c (getsize): Do SERVER estimate, call sendsize with + CALCSIZE estimate. + +2004-08-03 Jean-Louis Martineau + + * client-src/calcsize.c: Support exclude and include like gnutar, + change in program argument. + * client-src/sendsize.c: Execute calcsize as requested. + * common-src/amfeatures.h (fe_calcsize_estimate): New feature. + * common-src/amfeatures.c (am_init_feature_set): set + fe_calcsize_estimate. + * server-src/amcheck.c (start_host): Check if client support CALCSIZE + estimate. + +2004-08-03 Jean-Louis Martineau + + * server-src/conffile.h (ES_CLIENT, ES_SERVER, ES_CALCSIZE): New define + for estimate type. + * server-src/conffile.h (dumptype_t): Add 'estimate' and 's_estimate' + * server-src/conffile.c (get_estimate): New function to parse estimate + type, .... + * server-src/diskfile.c (read_diskline): Copy 'estimate'. + * server-src/diskfile.h (disk_t): Add 'estimate'. + * server-src/amadmin.c (disklist_one): Print estimate type. + +2004-08-02 Jean-Louis Martineau + + * common-src/match.c (match_tar, tar_to_regex): New fonction similar + to the exclude option of tar. + * common-src/amanda.h (match_tar, tar_to_regex): Prototype. + +2004-08-02 Jean-Louis Martineau + + * server-src/infofile.h (history_t): new struct. + * server-src/infofile.h (info_t): Add a history_t. + * server-src/infofile.c (read_txinfofile): Parse history data. + * server-src/infofile.c (write_txinfofile): Print history data. + * server-src/amadmin.c (export_one): export history data. + * server-src/amadmin.c (import_one): import history data. + * server-src/driverio.c (update_info_dumper): update history data. 2004-05-10 Jean-Louis Martineau Patch by Paul Bijnens * server-src/planner.c: Log L_DISK for autoflush disk. +2004-05-03 Jean-Louis Martineau + + * server-src/planner.c (handle_result): Add dp to pestq at the + correct place. + 2004-04-30 Jean-Louis Martineau * common-src/amanda.h: #include "amanda-int.h" only if !CONFIGURE_TEST. @@ -68,6 +498,19 @@ * server-src/planner.c (setup_estimate): Typo. +2004-04-22 Jean-Louis Martineau + + Allow bumpsize, bumppercent, bumpdays and bumpmult to be in a dumptype. + * server-src/conffile.c: Parse. + * server-src/conffile.h: Define. + * server-src/amadmin.c (disklist_one): Use. + * server-src/diskfile.c (read_diskline): Initialize. + * server-src/diskfile.h: Define. + * server-src/planner.c: Use. + * man/amanda.8.in: Document. + * NEWS: bumpsize, bumppercent, bumpdays and bumpmult can be in a + dumptype. + 2004-04-22 Jean-Louis Martineau Fix by Paul Bijnens @@ -93,6 +536,46 @@ * common-src/protocol.c: Fix EAGAIN on Linux. +2004-04-06 Jean-Louis Martineau + + New bumppercent global option. + * example/amanda.conf.in: Document it. + * man/amanda.8.in: Document it. + * server-src/amadmin.c (bumpsize): Write it. + * server-src/conffile.c: Parse it. + * server-src/conffile.h: Define It. + * server-src/planner.c (bump_thresh): New size_level_0 parameter, + use the new bumppercent option. + * NEWS: Document it. + +2004-04-05 Jean-Louis Martineau + + * server-src/amadmin.c: Rename host_t to amhost_t. + * server-src/amcheck.c: Ditto. + * server-src/amindexd.c: Ditto. + * server-src/diskfile.c: Ditto. + * server-src/diskfile.h: Ditto. + * server-src/driver.c: Ditto. + * server-src/planner.c: Ditto. + +2004-03-26 Jean-Louis Martineau + + * amplot/amplot.awk: Parse "driver: tape size" line. + +2004-03-22 Stefan G. Weichinger + + * server-src/amcheck.c (start_host): Added warning for hostname + localhost. + * docs/TOP-TEN-QUESTIONS: added note about localhost-warning. + +2004-03-19 Jean-Louis Martineau + + * docs/Makefile.am (pkgdata_DATA): Add TOP-TEN-QUESTIONS. + +2004-03-18 Stefan G. Weichinger + + * docs/TOP-TEN-QUESTIONS: New file. + 2004-03-16 Jean-Louis Martineau * server-src/amcheck.c: Do labelstr check in correct order. @@ -107,7 +590,29 @@ * server-src/amcheck.c: Verify the tape is listed in the tapelist file. * server-src/taper.c: Ditto * NEWS: * amanda will not use a tape if it's label is not in the - tapelist file (eg. after an amrmtape). + tapelist file (eg. after an amrmtape). + +2004-02-13 Jean-Louis Martineau + + * server-src/driver.c (dump_schedule): Print complete name. + +2004-02-13 Jean-Louis Martineau + + The estimate send a PREP (partial REP) packet after each estimate. + * client-src/amandad.c: Send PREP packet if sendsize. + * common-src/amfeatures.c (am_init_feature_set): Add + fe_partial_estimate. + * common-src/amfeatures.h (am_feature_e): Add fe_partial_estimate. + * common-src/protocol.c: Handle PREP packet. + * common-src/protocol.h (pktype_t): Add P_PREP. + * server-src/amstatus.pl.in: Parse "got partial result" line. + * server-src/planner.c: Handle PREP packet. + +2004-02-13 Jean-Louis Martineau + Reported by Jason Brooks + + * server-src/reporter.c: Remove duplicate setting of cd to + &ColumnData[Level]. 2004-02-12 Jean-Louis Martineau Patch by Philippe Charnier @@ -123,6 +628,39 @@ * recover-src/set_commands.c (cd_dir, set_directory): Fix memory leak. * recover-src/uscan.l: Fix double amfree. +2004-02-02 Jean-Louis Martineau + + * server-src/driver.c: Build holding disk name with timestamp. + * server-src/holding.c (is_datestr): Check also for timestamp. + * server-src/planner.c: Flush today's dump with autoflush. + * server-src/find.c: Find holding disk with timestamp. + * server-src/find.h (find_result_t): Add timestamp field. + * NEWS: holding disk disk use timestamped directory. + * NEWS: autoflush flush today's dump. + +2004-02-02 Jean-Louis Martineau + + * changer-src/chg-zd-mtx.sh.in: Works if all slot and tape are full. + +2004-02-02 Jean-Louis Martineau + + * server-src/amverifyrun.sh.in: Do not execute amverify if no tape + to verify. + +2004-02-02 Jean-Louis Martineau + + * server-src/amdump.sh.in: Do not redirect to /dev/null. + +2004-02-02 Jean-Louis Martineau + + * config/acinclude.m4i: Define CF_WAIT_INT. + * configure.in: Call CF_WAIT_INT. + * common-src/amanda.h: Try to make waitpid doesn't warn. + +2004-02-02 Jean-Louis Martineau + + * configure.in: AM_INIT_AUTOMAKE(amanda, 2.4.5b1). + 2004-01-29 Jean-Louis Martineau * Makefile.am (EXTRA_DIST): Add contrib/mkamandisk. diff --git a/Makefile.in b/Makefile.in index d6be98a..5234061 100644 --- a/Makefile.in +++ b/Makefile.in @@ -522,7 +522,7 @@ distclean-tags: distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) - $(mkdir_p) $(distdir)/amplot $(distdir)/changer-src $(distdir)/client-src $(distdir)/common-src $(distdir)/contrib $(distdir)/contrib/sst $(distdir)/example $(distdir)/man $(distdir)/patches $(distdir)/regex-src $(distdir)/regex-src/fake $(distdir)/server-src + $(mkdir_p) $(distdir)/amplot $(distdir)/changer-src $(distdir)/client-src $(distdir)/common-src $(distdir)/contrib $(distdir)/contrib/sst $(distdir)/example $(distdir)/patches $(distdir)/regex-src $(distdir)/regex-src/fake $(distdir)/server-src @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ diff --git a/NEWS b/NEWS index d2e98ef..1634f9c 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,24 @@ +Change in release 2.4.5 + +* new displayunit global option to select the unit use to display number + k=kilo, m=mega, g=giga, t=tera. +* new amoverview -skipmissed option. + +Change in release 2.4.5b1 + +* holding disk disk use timestamped directory. +* autoflush flush today's dump. +* new bumppercent global option, this should improve bumping criteria, + the bumpsize is set to a fixed value which can be adequate for small + and large disk. +* bumpsize, bumppercent, bumpdays and bumpmult can be in a dumptype. +* calcsize support include and exclude like gnutar. +* new 'estimate' dumptype option to select estimate type: + CLIENT: estimate by the dumping program. + CALCSIZE: estimate by the calcsize program, a lot faster but less acurate. + SERVER: estimate based on statistic from previous run, take second but + can be wrong on the estimate size. + Changes in release 2.4.4p3 * new chg-iomega changer script. diff --git a/acinclude.m4 b/acinclude.m4 index 60b9aec..8d31a3f 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -439,7 +439,33 @@ if test $cf_cv_arg_union_wait = yes; then AC_DEFINE(WAIT_USES_UNION,1,[Defined if wait() puts the status in a union wait instead of int. ]) fi ])dnl +AC_DEFUN([CF_WAIT_INT], +[ +AC_REQUIRE([AC_TYPE_PID_T]) +AC_HAVE_HEADERS(sys/wait.h wait.h) +AC_CACHE_CHECK([whether wait uses int], [cf_cv_arg_int], + [AC_TRY_COMPILE([ +#include +#if HAVE_SYS_WAIT_H +# include +#else +# if HAVE_WAIT_H +# include +# endif +#endif + +#ifdef __STDC__ +pid_t wait(int *); +#endif +], [ + int x; int i; + wait(&x); i = WIFEXITED(x) +], [cf_cv_arg_int=yes], [cf_cv_arg_int=no])]) +if test $cf_cv_arg_int = yes; then + AC_DEFINE(WAIT_USES_INT,1,[Defined if wait() puts the status in a int instead of a union wait. ]) +fi +])dnl dnl @synopsis AX_CREATE_STDINT_H [( HEADER-TO-GENERATE [, HEDERS-TO-CHECK])] dnl @@ -473,7 +499,7 @@ dnl Remember, if the system already had a valid , the generated dnl file will include it directly. No need for fuzzy HAVE_STDINT_H things... dnl dnl @, (status: used on new platforms) (see http://ac-archive.sf.net/gstdint/) -dnl @version $Id: acinclude.m4i,v 1.1.2.5.6.2 2004/04/29 20:47:40 martinea Exp $ +dnl @version $Id: acinclude.m4i,v 1.1.2.5.8.3 2004/04/29 20:47:22 martinea Exp $ dnl @author Guido Draheim AC_DEFUN([AX_CREATE_STDINT_H], diff --git a/amplot/amplot.awk b/amplot/amplot.awk index 97f2dd5..962c080 100644 --- a/amplot/amplot.awk +++ b/amplot/amplot.awk @@ -105,8 +105,11 @@ BEGIN{ else if( $7 == "START-TAPER") fil = $8; } else if( $2=="finished-cmd") cmd_fin++; - else if ($2=="started") forked++; + else if( $2=="started") forked++; else if( $2=="QUITTING") do_quit(); + else if( $2=="tape" && $3=="size") ; #eat this line + else if( $2=="dump" && $3=="failed") ; #eat this line + else if( $2=="taper" && $3=="failed") ; #eat this line else if( $2=="dumping" || $2 == "adding" || $2 == "holding-disks:") dumping++; # eat this line else if( $2!="FINISHED" && $2 != "pid" && $2 != "taper-tryagain"&& $2!="startaflush:") diff --git a/changer-src/chg-multi.sh.in b/changer-src/chg-multi.sh.in index 0103c81..d670318 100644 --- a/changer-src/chg-multi.sh.in +++ b/changer-src/chg-multi.sh.in @@ -29,6 +29,11 @@ # # chg-multi.sh - generic tape changer script # +# chg-multi is 'not' intended for use with tape changers or +# libraries. It is primarily used to make several, individual +# tape drives appear to amanda as a single changer or library. +# The "multi" in the script name refers to multiple drives. +# prefix=@prefix@ exec_prefix=@exec_prefix@ diff --git a/changer-src/chg-zd-mtx.sh.in b/changer-src/chg-zd-mtx.sh.in index 6cf5b18..1064eb0 100644 --- a/changer-src/chg-zd-mtx.sh.in +++ b/changer-src/chg-zd-mtx.sh.in @@ -447,39 +447,82 @@ get_loaded_info() { get_mtx_status set x `sed -n ' -/^Data Transfer Element:Empty/ { +/^Data Transfer Element:Empty/ { s/.*/-1/p q } -/^Data Transfer Element '$driveslot':Empty/ { +/^Data Transfer Element '$driveslot':Empty/ { s/.*/-1/p q } -/^Data Transfer Element:Full.*:VolumeTag/ { - s/.*(Storage Element \([0-9][0-9]*\) Loaded):VolumeTag *= *\([^ ]*\)/\1 \2/p +/^Data Transfer Element:Full (Storage Element \([0-9][0-9]*\) Loaded):VolumeTag *= *\([^ ]*\)/ { + s/.*(Storage Element \([0-9][0-9]*\) Loaded):VolumeTag *= *\([^ ]*\)/\1 \2/p q } -/^Data Transfer Element '$driveslot':Full.*:VolumeTag/ { - s/.*(Storage Element \([0-9][0-9]*\) Loaded):VolumeTag *= *\([^ ]*\)/\1 \2/p +/^Data Transfer Element '$driveslot':Full (Storage Element \([0-9][0-9]*\) Loaded):VolumeTag *= *\([^ ]*\)/ { + s/.*(Storage Element \([0-9][0-9]*\) Loaded):VolumeTag *= *\([^ ]*\)/\1 \2/p q } -/^Data Transfer Element:Full/ { - s/.*(Storage Element \([0-9][0-9]*\) Loaded)\(.*\)/\1/p +/^Data Transfer Element '$driveslot':Full (Unknown Storage Element Loaded):VolumeTag *= *\([^ ]*\)/ { + s/.*:VolumeTag *= *\([^ ]*\)/-2 \1/p q } -/^Data Transfer Element '$driveslot':Full/ { - s/.*(Storage Element \([0-9][0-9]*\) Loaded)\(.*\)/\1/p +/^Data Transfer Element:Full (Storage Element \([0-9][0-9]*\) Loaded)/ { + s/.*(Storage Element \([0-9][0-9]*\) Loaded).*/\1/p + q +} +/^Data Transfer Element '$driveslot':Full (Storage Element \([0-9][0-9]*\) Loaded)/ { + s/.*Storage Element \([0-9][0-9]*\) Loaded.*/\1/p + q +} +/^Data Transfer Element '$driveslot':Full (Unknown Storage Element Loaded)/ { + s/.*/-2/p q } ' < $mtx_status 2>&1` shift # get rid of the "x" loadedslot=$1 loadedbarcode=$2 - if [ -z "$loadedslot" ]; then Exit 2 "" "could not determine current slot, are you sure your drive slot is $driveslot" return $? # in case we are internal fi + + #Use the current slot if it's empty and we don't know which slot is loaded' + if [ $loadedslot -eq -2 ]; then + set x `sed -n ' +{ + /^.*Storage Element '$currentslot':Empty/ { + s/.*Storage Element \([0-9][0-9]*\):Empty/\1/p + q + } + /^.*Storage Element '$currentslot':Full/ { + s/.*Storage Element \([0-9][0-9]*\):Full/-2/p + q + } +} +' < $mtx_status 2>& 1` + shift # get rid of the "x" + loadedslotx=$1 + if [ ! -z $loadedslotx ]; then + loadedslot=$loadedslotx + fi + fi + + #Use the first empty slot if we don't know which slot is loaded' + if [ $loadedslot -eq -2 ]; then + set x `sed -n ' +{ + /^.*Storage Element \([0-9][0-9]*\):Empty/ { + s/.*Storage Element \([0-9][0-9]*\):Empty/\1/p + q + } +} +' < $mtx_status 2>& 1` + shift # get rid of the "x" + loadedslot=$1 + fi + if IsNumeric "$loadedslot" ; then : else @@ -506,14 +549,25 @@ get_slot_list() { fi get_mtx_status slot_list=`sed -n ' -/^Data Transfer Element:Full/ { - s/.*(Storage Element \([0-9][0-9]*\) Loaded)\(.*\)/\1/p +/^Data Transfer Element:Full (Storage Element \([0-9][0-9]*\) Loaded)/ { + s/.*(Storage Element \([0-9][0-9]*\) Loaded).*/\1/p } -/^Data Transfer Element '$driveslot':Full/ { - s/.*(Storage Element \([0-9][0-9]*\) Loaded)\(.*\)/\1/p +/^Data Transfer Element '$driveslot':Full (Storage Element \([0-9][0-9]*\) Loaded)/ { + s/.*Storage Element \([0-9][0-9]*\) Loaded.*/\1/p } -/^[ ]*Storage Element \([0-9][0-9]*\):Full/ { - s/.*Storage Element \([0-9][0-9]*\):.*/\1/p +/^Data Transfer Element '$driveslot':Full (Unknown Storage Element Loaded)/ { + : loop + n + /^.*Storage Element \([0-9][0-9]*\):Full/ { + s/.*Storage Element \([0-9][0-9]*\):Full.*/\1/p + b loop + } + /^.*Storage Element \([0-9][0-9]*\):Empty/ { + s/.*Storage Element \([0-9][0-9]*\):Empty/\1/p + } +} +/^.*Storage Element \([0-9][0-9]*\):Full/ { + s/.*Storage Element \([0-9][0-9]*\):Full.*/\1/p } ' < $mtx_status 2>&1 | grep -v "^${cleanslot}\$" | sort -n` slot_list=`echo $slot_list` # remove the newlines @@ -946,6 +1000,10 @@ loadslot() { Exit 0 "$loadedslot" "$tape" return $? # in case we are internal fi + if [ $loadedslot -eq -2 ]; then + Exit 0 "$loadedslot" "$tape" + return $? # in case we are internal + fi # If we are loading the cleaning tape, bump the cleaning count # and reset the access count. Otherwise, bump the access count diff --git a/changer-src/scsi-cam.c b/changer-src/scsi-cam.c index d4a2eb0..df966bd 100644 --- a/changer-src/scsi-cam.c +++ b/changer-src/scsi-cam.c @@ -24,7 +24,7 @@ * file named AUTHORS, in the root directory of this distribution. */ /* - * $Id: scsi-cam.c,v 1.10.4.1.2.4 2004/04/29 20:47:40 martinea Exp $ + * $Id: scsi-cam.c,v 1.10.4.1.2.3.2.1 2004/04/29 20:47:21 martinea Exp $ * * Interface to execute SCSI commands on an system with cam support * Current support is for FreeBSD 4.x @@ -75,7 +75,7 @@ extern FILE *debug_file; void SCSI_OS_Version() { #ifndef lint - static char rcsid[] = "$Id: scsi-cam.c,v 1.10.4.1.2.4 2004/04/29 20:47:40 martinea Exp $"; + static char rcsid[] = "$Id: scsi-cam.c,v 1.10.4.1.2.3.2.1 2004/04/29 20:47:21 martinea Exp $"; DebugPrint(DEBUG_INFO, SECTION_INFO, "scsi-os-layer: %s\n",rcsid); #endif } diff --git a/client-src/amandad.c b/client-src/amandad.c index dd69e93..d0e48fb 100644 --- a/client-src/amandad.c +++ b/client-src/amandad.c @@ -25,7 +25,7 @@ * University of Maryland at College Park */ /* - * $Id: amandad.c,v 1.32.2.4.4.1.2.6 2003/12/16 22:36:45 martinea Exp $ + * $Id: amandad.c,v 1.32.2.4.4.1.2.6.2.1 2004/02/13 14:01:07 martinea Exp $ * * handle client-host side of Amanda network communications, including * security checks, execution of the proper service, and acking the @@ -39,6 +39,7 @@ #include "version.h" #include "protocol.h" #include "util.h" +#include "client_util.h" #define RECV_TIMEOUT 30 #define ACK_TIMEOUT 10 /* XXX should be configurable */ @@ -75,7 +76,7 @@ int ack_timeout = ACK_TIMEOUT; int main P((int argc, char **argv)); void sendack P((pkt_t *hdr, pkt_t *msg)); void sendnak P((pkt_t *hdr, pkt_t *msg, char *str)); -void setup_rep P((pkt_t *hdr, pkt_t *msg)); +void setup_rep P((pkt_t *hdr, pkt_t *msg, int partial_rep)); char *strlower P((char *str)); int main(argc, argv) @@ -94,7 +95,7 @@ char **argv; out_msg: Standard, i.e. non-repeated, ACK and REP. rej_msg: Any other outgoing message. */ - pkt_t in_msg, out_msg, rej_msg, dup_msg; + pkt_t in_msg, out_msg, out_pmsg, rej_msg, dup_msg; char *cmd = NULL, *base = NULL; char *noop_file = NULL; char **vp; @@ -106,6 +107,7 @@ char **argv; char number[NUM_STR_SIZE]; am_feature_t *our_features = NULL; char *our_feature_string = NULL; + int send_partial_reply = 0; struct service_s *servp; fd_set insock; @@ -200,6 +202,9 @@ char **argv; dgram_zero(&out_msg.dgram); dgram_socket(&out_msg.dgram, 0); + dgram_zero(&out_pmsg.dgram); + dgram_socket(&out_pmsg.dgram, 0); + dgram_zero(&rej_msg.dgram); dgram_socket(&rej_msg.dgram, 0); @@ -312,7 +317,7 @@ char **argv; if(!(servp->flags & NO_AUTH) && !security_ok(&in_msg.peer, in_msg.security, in_msg.cksum, &errstr)) { /* XXX log on authlog? */ - setup_rep(&in_msg, &out_msg); + setup_rep(&in_msg, &out_msg, 0); ap_snprintf(out_msg.dgram.cur, sizeof(out_msg.dgram.data)-out_msg.dgram.len, "ERROR %s\n", errstr); @@ -362,6 +367,22 @@ char **argv; amfree(s); (void)lseek(rep_pipe[0], (off_t)0, SEEK_SET); } else { + if(strcmp(servp->name, "sendsize") == 0) { + if(strncmp(in_msg.dgram.cur,"OPTIONS ",8) == 0) { + g_option_t *g_options; + char *option_str, *p; + + option_str = stralloc(in_msg.dgram.cur+8); + p = strchr(option_str,'\n'); + if(p) *p = '\0'; + + g_options = parse_g_options(option_str, 0); + if(am_has_feature(g_options->features, fe_partial_estimate)) { + send_partial_reply = 1; + } + amfree(option_str); + } + } if(pipe(req_pipe) == -1 || pipe(rep_pipe) == -1) error("pipe: %s", strerror(errno)); @@ -433,9 +454,13 @@ char **argv; aclose(req_pipe[1]); } - setup_rep(&in_msg, &out_msg); + setup_rep(&in_msg, &out_msg, 0); + if(send_partial_reply) { + setup_rep(&in_msg, &out_pmsg, 1); + } #ifdef KRB4_SECURITY add_mutual_authenticator(&out_msg.dgram); + add_mutual_authenticator(&out_pmsg.dgram); #endif while(1) { @@ -468,7 +493,17 @@ char **argv; } break; } - dglen += rc; + else { + if(send_partial_reply) { + strncpy(out_pmsg.dgram.cur+dglen, out_msg.dgram.cur+dglen, rc); + out_pmsg.dgram.len += rc; + out_pmsg.dgram.data[out_pmsg.dgram.len] = '\0'; + dbprintf(("%s: sending PREP packet:\n----\n%s----\n\n", + debug_prefix_time(NULL), out_pmsg.dgram.data)); + dgram_send_addr(in_msg.peer, &out_pmsg.dgram); + } + dglen += rc; + } } if(!FD_ISSET(0,&insock)) continue; @@ -637,14 +672,16 @@ char *str; dgram_send_addr(hdr->peer, &msg->dgram); } -void setup_rep(hdr, msg) +void setup_rep(hdr, msg, partial_rep) pkt_t *hdr; pkt_t *msg; +int partial_rep; { /* XXX this isn't very safe either: handle could be bogus */ ap_snprintf(msg->dgram.data, sizeof(msg->dgram.data), - "Amanda %d.%d REP HANDLE %s SEQ %d\n", + "Amanda %d.%d %s HANDLE %s SEQ %d\n", VERSION_MAJOR, VERSION_MINOR, + partial_rep == 0 ? "REP" : "PREP", hdr->handle ? hdr->handle : "", hdr->sequence); diff --git a/client-src/amqde.c b/client-src/amqde.c index 731ad09..a0ec139 100644 --- a/client-src/amqde.c +++ b/client-src/amqde.c @@ -24,7 +24,7 @@ * file named AUTHORS, in the root directory of this distribution. */ /* - * $Id: amqde.c,v 1.1.2.1 2003/10/24 20:38:23 kovert Exp $ + * $Id: amqde.c,v 1.1.2.1.2.1 2004/08/05 11:35:35 martinea Exp $ * * the central header file included by all amanda sources */ @@ -147,7 +147,7 @@ main(argc, argv) if (strcmp(de->d_name, ".") == 0 || strcmp(de->d_name, "..") == 0) continue; - snprintf(buf, sizeof(buf) - 1, "%s/%s", new->dirname, de->d_name); + ap_snprintf(buf, sizeof(buf) - 1, "%s/%s", new->dirname, de->d_name); #ifdef USE_STRHASH if (should_exclude(hash, buf)) diff --git a/client-src/calcsize.c b/client-src/calcsize.c index 97a032a..aa95bb2 100644 --- a/client-src/calcsize.c +++ b/client-src/calcsize.c @@ -24,12 +24,13 @@ * file named AUTHORS, in the root directory of this distribution. */ /* - * $Id: calcsize.c,v 1.24.2.3.6.1 2002/03/31 21:01:32 jrjackson Exp $ + * $Id: calcsize.c,v 1.24.2.3.6.1.2.3 2005/02/09 17:56:52 martinea Exp $ * * traverse directory tree to get backup size estimates */ #include "amanda.h" #include "statfs.h" +#include "sl.h" #define ROUND(n,x) ((x) + (n) - 1 - (((x) + (n) - 1) % (n))) @@ -44,7 +45,7 @@ unsigned long n, x; } */ -# define ST_BLOCKS(s) ((s).st_size / 512 + (((s).st_size % 512) ? 1 : 0)) +#define ST_BLOCKS(s) ((((s).st_blocks * 512) <= (s).st_size) ? (s).st_blocks+1 : ((s).st_size / 512 + (((s).st_size % 512) ? 1 : 0))) #define FILETYPES (S_IFREG|S_IFLNK|S_IFDIR) @@ -62,34 +63,39 @@ struct { int total_dirs; int total_files; long total_size; + long total_size_name; } dumpstats[MAXDUMPS]; time_t dumpdate[MAXDUMPS]; int dumplevel[MAXDUMPS]; int ndumps; +void (*add_file_name) P((int, char *)); void (*add_file) P((int, struct stat *)); long (*final_size) P((int, char *)); int main P((int, char **)); -void traverse_dirs P((char *)); +void traverse_dirs P((char *, char *)); +void add_file_name_dump P((int, char *)); void add_file_dump P((int, struct stat *)); long final_size_dump P((int, char *)); +void add_file_name_gnutar P((int, char *)); void add_file_gnutar P((int, struct stat *)); long final_size_gnutar P((int, char *)); +void add_file_name_unknown P((int, char *)); void add_file_unknown P((int, struct stat *)); long final_size_unknown P((int, char *)); -#ifdef BUILTIN_EXCLUDE_SUPPORT +sl_t *calc_load_file P((char *filename)); +int calc_check_exclude P((char *filename)); + int use_gtar_excl = 0; -char exclude_string[] = "--exclude="; -char exclude_list_string[] = "--exclude-list="; -#endif +sl_t *include_sl=NULL, *exclude_sl=NULL; int main(argc, argv) int argc; @@ -135,7 +141,7 @@ char **argv; return 0; #else int i; - char *dirname=NULL, *amname=NULL; + char *dirname=NULL, *amname=NULL, *filename=NULL; int fd; unsigned long malloc_hist_1, malloc_size_1; unsigned long malloc_hist_2, malloc_size_2; @@ -165,17 +171,8 @@ char **argv; /* need at least program, amname, and directory name */ if(argc < 3) { -#ifdef BUILTIN_EXCLUDE_SUPPORT - usage: -#endif - error("Usage: %s [DUMP|GNUTAR%s] name dir [level date] ...", - get_pname(), -#ifdef BUILTIN_EXCLUDE_SUPPORT - " [-X --exclude[-list]=regexp]" -#else - "" -#endif - ); + error("Usage: %s [DUMP|GNUTAR%s] name dir [-X exclude-file] [-I include-file] [level date]*", + get_pname()); return 1; } @@ -186,6 +183,7 @@ char **argv; error("dump not available on this system"); return 1; #else + add_file_name = add_file_name_dump; add_file = add_file_dump; final_size = final_size_dump; #endif @@ -195,53 +193,18 @@ char **argv; error("gnutar not available on this system"); return 1; #else + add_file_name = add_file_name_gnutar; add_file = add_file_gnutar; final_size = final_size_gnutar; -#ifdef BUILTIN_EXCLUDE_SUPPORT use_gtar_excl++; -#endif #endif } else { + add_file_name = add_file_name_unknown; add_file = add_file_unknown; final_size = final_size_unknown; } argc--, argv++; -#ifdef BUILTIN_EXCLUDE_SUPPORT - if ((argc > 1) && strcmp(*argv,"-X") == 0) { - char *result = NULL; - char *cp = NULL; - argv++; - - if (!use_gtar_excl) { - error("exclusion specification not supported"); - return 1; - } - - result = stralloc(*argv); - if (*result && (cp = strrchr(result,';'))) - /* delete trailing ; */ - *cp = 0; - if (strncmp(result, exclude_string, sizeof(exclude_string)-1) == 0) - add_exclude(result+sizeof(exclude_string)-1); - else if (strncmp(result, exclude_list_string, - sizeof(exclude_list_string)-1) == 0) { - if (access(result + sizeof(exclude_list_string)-1, R_OK) != 0) { - fprintf(stderr,"Cannot open exclude file %s\n",cp+1); - use_gtar_excl = 0; - } else { - add_exclude_file(result + sizeof(exclude_list_string)-1); - } - } else { - amfree(result); - goto usage; - } - amfree(result); - argc -= 2; - argv++; - } else - use_gtar_excl = 0; -#endif /* the amanda name can be different from the directory name */ @@ -258,6 +221,42 @@ char **argv; } else error("missing "); + if ((argc > 1) && strcmp(*argv,"-X") == 0) { + argv++; + + if (!use_gtar_excl) { + error("exclusion specification not supported"); + return 1; + } + + filename = stralloc(*argv); + if (access(filename, R_OK) != 0) { + fprintf(stderr,"Cannot open exclude file %s\n",filename); + use_gtar_excl = 0; + } else { + exclude_sl = calc_load_file(filename); + } + amfree(filename); + argc -= 2; + argv++; + } else + use_gtar_excl = 0; + + if ((argc > 1) && strcmp(*argv,"-I") == 0) { + argv++; + + filename = stralloc(*argv); + if (access(filename, R_OK) != 0) { + fprintf(stderr,"Cannot open include file %s\n",filename); + use_gtar_excl = 0; + } else { + include_sl = calc_load_file(filename); + } + amfree(filename); + argc -= 2; + argv++; + } + /* the dump levels to calculate sizes for */ ndumps = 0; @@ -273,14 +272,28 @@ char **argv; if(argc) error("leftover arg \"%s\", expected and ", *argv); - traverse_dirs(dirname); + if(is_empty_sl(include_sl)) { + traverse_dirs(dirname,"."); + } + else { + sle_t *an_include = include_sl->first; + while(an_include != NULL) { +/* + char *adirname = stralloc2(dirname, an_include->name+1); + traverse_dirs(adirname); + amfree(adirname); +*/ + traverse_dirs(dirname, an_include->name); + an_include = an_include->next; + } + } for(i = 0; i < ndumps; i++) { amflock(1, "size"); lseek(1, (off_t)0, SEEK_END); - printf("%s %d SIZE %ld\n", + fprintf(stderr, "%s %d SIZE %ld\n", amname, dumplevel[i], final_size(i, dirname)); fflush(stdout); @@ -316,8 +329,9 @@ char *file; void push_name P((char *str)); char *pop_name P((void)); -void traverse_dirs(parent_dir) +void traverse_dirs(parent_dir, include) char *parent_dir; +char *include; { DIR *d; struct dirent *f; @@ -327,22 +341,22 @@ char *parent_dir; dev_t parent_dev = 0; int i; int l; + int parent_len; + int has_exclude = !is_empty_sl(exclude_sl) && use_gtar_excl; + + char *aparent = vstralloc(parent_dir, "/", include, NULL); if(parent_dir && stat(parent_dir, &finfo) != -1) parent_dev = finfo.st_dev; - push_name(parent_dir); + parent_len = strlen(parent_dir); - for(dirname = pop_name(); dirname; free(dirname), dirname = pop_name()) { + push_name(aparent); -#ifdef BUILTIN_EXCLUDE_SUPPORT - if(use_gtar_excl && - (check_exclude(basename(dirname)) || - check_exclude(dirname))) - /* will not be added by gnutar */ + for(dirname = pop_name(); dirname; free(dirname), dirname = pop_name()) { + if(has_exclude && calc_check_exclude(dirname+parent_len+1)) { continue; -#endif - + } if((d = opendir(dirname)) == NULL) { perror(dirname); continue; @@ -356,6 +370,9 @@ char *parent_dir; } while((f = readdir(d)) != NULL) { + int is_symlink = 0; + int is_dir; + int is_file; if(is_dot_or_dotdot(f->d_name)) { continue; } @@ -371,31 +388,39 @@ char *parent_dir; continue; } - if((finfo.st_mode & S_IFMT) == S_IFDIR) { - push_name(newname); - } - - for(i = 0; i < ndumps; i++) { - if(finfo.st_ctime >= dumpdate[i]) { - int exclude = 0; - int is_symlink = 0; - -#ifdef BUILTIN_EXCLUDE_SUPPORT - exclude = check_exclude(f->d_name); -#endif #ifdef S_IFLNK - is_symlink = ((finfo.st_mode & S_IFMT) == S_IFLNK); + is_symlink = ((finfo.st_mode & S_IFMT) == S_IFLNK); #endif - if (! exclude && - /* regular files */ - ((finfo.st_mode & S_IFMT) == S_IFREG - /* directories */ - || (finfo.st_mode & S_IFMT) == S_IFDIR - /* symbolic links */ - || is_symlink)) { + is_dir = ((finfo.st_mode & S_IFMT) == S_IFDIR); + is_file = ((finfo.st_mode & S_IFMT) == S_IFREG); + + if (!(is_file || is_dir || is_symlink)) { + continue; + } + + { + int is_excluded = -1; + for(i = 0; i < ndumps; i++) { + add_file_name(i, newname); + if(is_file && finfo.st_ctime >= dumpdate[i]) { + + if(has_exclude) { + if(is_excluded == -1) + is_excluded = + calc_check_exclude(newname+parent_len+1); + if(is_excluded == 1) { + i = ndumps; + continue; + } + } add_file(i, &finfo); } } + if(is_dir) { + if(has_exclude && calc_check_exclude(newname+parent_len+1)) + continue; + push_name(newname); + } } } @@ -408,6 +433,7 @@ char *parent_dir; } amfree(newbase); amfree(newname); + amfree(aparent); } void push_name(str) @@ -452,6 +478,13 @@ char *pop_name() * requirements for files with holes, nor the dumping of directories that * are not themselves modified. */ +void add_file_name_dump(level, name) +int level; +char *name; +{ + return; +} + void add_file_dump(level, sp) int level; struct stat *sp; @@ -496,12 +529,20 @@ char *topdir; * * As with DUMP, we only need a reasonable estimate, not an exact figure. */ +void add_file_name_gnutar(level, name) +int level; +char *name; +{ +/* dumpstats[level].total_size_name += strlen(name) + 64;*/ + dumpstats[level].total_size += 1; +} + void add_file_gnutar(level, sp) int level; struct stat *sp; { /* the header takes one additional block */ - dumpstats[level].total_size += ROUND(4,(ST_BLOCKS(*sp) + 1)); + dumpstats[level].total_size += ST_BLOCKS(*sp); } long final_size_gnutar(level, topdir) @@ -510,7 +551,7 @@ char *topdir; { /* divide by two to get kbytes, rounded up */ /* + 4 blocks for security */ - return (dumpstats[level].total_size + 5) / 2; + return (dumpstats[level].total_size + 5 + (dumpstats[level].total_size_name/512)) / 2; } /* @@ -520,6 +561,13 @@ char *topdir; * Here we'll just add up the file sizes and output that. */ +void add_file_name_unknown(level, name) +int level; +char *name; +{ + return; +} + void add_file_unknown(level, sp) int level; struct stat *sp; @@ -536,3 +584,41 @@ char *topdir; /* divide by two to get kbytes, rounded up */ return (dumpstats[level].total_size + 1) / 2; } + +/* + * ========================================================================= + */ +sl_t *calc_load_file(filename) +char *filename; +{ + char pattern[1025]; + + sl_t *sl_list = new_sl(); + + FILE *file = fopen(filename, "r"); + + while(fgets(pattern, 1025, file)) { + if(strlen(pattern)>0 && pattern[strlen(pattern)-1] == '\n') + pattern[strlen(pattern)-1] = '\0'; + sl_list = append_sl(sl_list, pattern); + } + fclose(file); + + return sl_list; +} + +int calc_check_exclude(filename) +char *filename; +{ + sle_t *an_exclude; + if(is_empty_sl(exclude_sl)) return 0; + + an_exclude=exclude_sl->first; + while(an_exclude != NULL) { + if(match_tar(an_exclude->name, filename)) { + return 1; + } + an_exclude=an_exclude->next; + } + return 0; +} diff --git a/client-src/selfcheck.c b/client-src/selfcheck.c index 0cfade8..a82af7c 100644 --- a/client-src/selfcheck.c +++ b/client-src/selfcheck.c @@ -25,7 +25,7 @@ * University of Maryland at College Park */ /* - * $Id: selfcheck.c,v 1.40.2.3.4.4.2.22 2003/11/18 18:04:26 martinea Exp $ + * $Id: selfcheck.c,v 1.40.2.3.4.4.2.22.2.2 2004/08/12 12:30:53 martinea Exp $ * * do self-check and send back any error messages */ @@ -58,6 +58,7 @@ int need_vxrestore=0; int need_runtar=0; int need_gnutar=0; int need_compress_path=0; +int need_calcsize=0; static am_feature_t *our_features = NULL; static char *our_feature_string = NULL; @@ -66,8 +67,8 @@ static g_option_t *g_options = NULL; /* local functions */ int main P((int argc, char **argv)); -static void check_options P((char *program, char *disk, char *device, option_t *options)); -static void check_disk P((char *program, char *disk, char *amdevice, int level)); +static void check_options P((char *program, char *calcprog, char *disk, char *device, option_t *options)); +static void check_disk P((char *program, char *calcprog, char *disk, char *amdevice, int level)); static void check_overall P((void)); static void check_access P((char *filename, int mode)); static void check_file P((char *filename, int mode)); @@ -82,6 +83,7 @@ char **argv; int level; char *line = NULL; char *program = NULL; + char *calcprog = NULL; char *disk = NULL; char *device = NULL; char *optstr = NULL; @@ -155,6 +157,19 @@ char **argv; skip_non_whitespace(s, ch); s[-1] = '\0'; /* terminate the program name */ + if(strncmp(program, "CALCSIZE", 8) == 0) { + skip_whitespace(s, ch); /* find program name */ + if (ch == '\0') { + goto err; /* no program */ + } + calcprog = s - 1; + skip_non_whitespace(s, ch); + s[-1] = '\0'; + } + else { + calcprog = NULL; + } + skip_whitespace(s, ch); /* find disk name */ if (ch == '\0') { goto err; /* no disk */ @@ -198,8 +213,8 @@ char **argv; skip_non_whitespace(s, ch); s[-1] = '\0'; /* terminate the options */ options = parse_options(optstr, disk, device, g_options->features, 1); - check_options(program, disk, device, options); - check_disk(program, disk, device, level); + check_options(program, calcprog, disk, device, options); + check_disk(program, calcprog, disk, device, level); free_sl(options->exclude_file); free_sl(options->exclude_list); free_sl(options->include_file); @@ -221,7 +236,8 @@ char **argv; need_runtar=1; need_gnutar=1; need_compress_path=1; - check_disk(program, disk, device, level); + need_calcsize=1; + check_disk(program, calcprog, disk, device, level); } else { goto err; /* bad syntax */ } @@ -265,11 +281,34 @@ char **argv; static void -check_options(program, disk, device, options) - char *program, *disk, *device; +check_options(program, calcprog, disk, device, options) + char *program, *calcprog, *disk, *device; option_t *options; { - if(strcmp(program,"GNUTAR") == 0) { + char *myprogram = program; + + if(strcmp(myprogram,"CALCSIZE") == 0) { + int nb_exclude = 0; + int nb_include = 0; + char *file_exclude = NULL; + char *file_include = NULL; + + if(options->exclude_file) nb_exclude += options->exclude_file->nb_element; + if(options->exclude_list) nb_exclude += options->exclude_list->nb_element; + if(options->include_file) nb_include += options->include_file->nb_element; + if(options->include_list) nb_include += options->include_list->nb_element; + + if(nb_exclude > 0) file_exclude = build_exclude(disk, device, options, 1); + if(nb_include > 0) file_include = build_include(disk, device, options, 1); + + amfree(file_exclude); + amfree(file_include); + + need_calcsize=1; + myprogram = calcprog; + } + + if(strcmp(myprogram,"GNUTAR") == 0) { need_gnutar=1; if(disk[0] == '/' && disk[1] == '/') { if(options->exclude_file && options->exclude_file->nb_element > 1) { @@ -308,7 +347,8 @@ check_options(program, disk, device, options) need_runtar=1; } } - if(strcmp(program,"DUMP") == 0) { + + if(strcmp(myprogram,"DUMP") == 0) { if(options->exclude_file && options->exclude_file->nb_element > 0) { printf("ERROR [DUMP does not support exclude file]\n"); } @@ -382,8 +422,8 @@ check_options(program, disk, device, options) need_compress_path=1; } -static void check_disk(program, disk, amdevice, level) -char *program, *disk, *amdevice; +static void check_disk(program, calcprog, disk, amdevice, level) +char *program, *calcprog, *disk, *amdevice; int level; { char *device = NULL; @@ -395,10 +435,22 @@ int level; int access_result; char *access_type; char *extra_info = NULL; + char *myprogram = program; + + if(strcmp(myprogram,"CALCSIZE") == 0) { + if(amdevice[0] == '/' && amdevice[1] == '/') { + err = vstralloc("Can't use CALCSIZE for samba estimate,", + " use CLIENT: ", + amdevice, + NULL); + goto common_exit; + } + myprogram = calcprog; + } dbprintf(("%s: checking disk %s\n", debug_prefix_time(NULL), disk)); - if (strcmp(program, "GNUTAR") == 0) { + if (strcmp(myprogram, "GNUTAR") == 0) { if(amdevice[0] == '/' && amdevice[1] == '/') { #ifdef SAMBA_CLIENT int nullfd, checkerr; @@ -718,6 +770,16 @@ static void check_overall() #endif } + if( need_calcsize ) { + char *cmd; + + cmd = vstralloc(libexecdir, "/", "calcsize", versionsuffix(), NULL); + + check_file(cmd, X_OK); + + amfree(cmd); + } + if( need_samba ) { #ifdef SAMBA_CLIENT check_file(SAMBA_CLIENT, X_OK); diff --git a/client-src/sendbackup-gnutar.c b/client-src/sendbackup-gnutar.c index 2fdac32..077dca4 100644 --- a/client-src/sendbackup-gnutar.c +++ b/client-src/sendbackup-gnutar.c @@ -24,7 +24,7 @@ * file named AUTHORS, in the root directory of this distribution. */ /* - * $Id: sendbackup-gnutar.c,v 1.56.2.15.4.4.2.11 2003/10/30 18:04:45 martinea Exp $ + * $Id: sendbackup-gnutar.c,v 1.56.2.15.4.4.2.11.2.1 2004/08/31 13:39:08 martinea Exp $ * * send backup data using GNU tar */ @@ -552,25 +552,29 @@ int goterror; { if(!options->no_record && !goterror) { #ifdef GNUTAR_LISTED_INCREMENTAL_DIR - if (incrname != NULL && strlen(incrname) > 4) { - char *nodotnew; + if (incrname != NULL && strlen(incrname) > 4) { + char *nodotnew; - nodotnew = stralloc(incrname); - nodotnew[strlen(nodotnew)-4] = '\0'; - if (rename(incrname, nodotnew) != 0) { - error("error [renaming %s to %s: %s]", - incrname, nodotnew, strerror(errno)); + nodotnew = stralloc(incrname); + nodotnew[strlen(nodotnew)-4] = '\0'; + if (rename(incrname, nodotnew) != 0) { + fprintf(stderr, "%s: warning [renaming %s to %s: %s]\n", + get_pname(), incrname, nodotnew, strerror(errno)); + } + amfree(nodotnew); + amfree(incrname); } - amfree(nodotnew); - amfree(incrname); - } #endif - if(!start_amandates(1)) - error("error [opening %s: %s]", AMANDATES_FILE, strerror(errno)); - amandates_updateone(cur_disk, cur_level, cur_dumptime); - finish_amandates(); - free_amandates(); + if(!start_amandates(1)) { + fprintf(stderr, "%s: warning [opening %s: %s]\n", get_pname(), + AMANDATES_FILE, strerror(errno)); + } + else { + amandates_updateone(cur_disk, cur_level, cur_dumptime); + finish_amandates(); + free_amandates(); + } } } diff --git a/client-src/sendsize.c b/client-src/sendsize.c index c13f875..b7bf688 100644 --- a/client-src/sendsize.c +++ b/client-src/sendsize.c @@ -24,7 +24,7 @@ * file named AUTHORS, in the root directory of this distribution. */ /* - * $Id: sendsize.c,v 1.97.2.13.4.6.2.23 2003/10/24 20:38:23 kovert Exp $ + * $Id: sendsize.c,v 1.97.2.13.4.6.2.23.2.3 2005/04/06 12:31:04 martinea Exp $ * * send estimated backup sizes using dump */ @@ -79,6 +79,7 @@ typedef struct disk_estimates_s { char *amdevice; char *dirname; char *program; + char *calcprog; int spindle; pid_t child; int done; @@ -95,7 +96,7 @@ static g_option_t *g_options = NULL; /* local functions */ int main P((int argc, char **argv)); void add_diskest P((char *disk, char *amdevice, int level, int spindle, - char *prog, option_t *options)); + char *prog, char *calcprog, option_t *options)); void calc_estimates P((disk_estimates_t *est)); void free_estimates P((disk_estimates_t *est)); void dump_calc_estimates P((disk_estimates_t *)); @@ -109,7 +110,7 @@ int argc; char **argv; { int level, spindle; - char *prog, *disk, *amdevice, *dumpdate; + char *prog, *calcprog, *disk, *amdevice, *dumpdate; option_t *options = NULL; disk_estimates_t *est; disk_estimates_t *est1; @@ -196,6 +197,20 @@ char **argv; skip_non_whitespace(s, ch); s[-1] = '\0'; + if(strncmp(prog, "CALCSIZE", 8) == 0) { + skip_whitespace(s, ch); /* find the program name */ + if(ch == '\0') { + err_extra = "no program name"; + goto err; + } + calcprog = s - 1; + skip_non_whitespace(s, ch); + s[-1] = '\0'; + } + else { + calcprog = NULL; + } + skip_whitespace(s, ch); /* find the disk name */ if(ch == '\0') { err_extra = "no disk name"; @@ -281,7 +296,7 @@ char **argv; } } - add_diskest(disk, amdevice, level, spindle, prog, options); + add_diskest(disk, amdevice, level, spindle, prog, calcprog, options); amfree(amdevice); } amfree(line); @@ -437,8 +452,8 @@ char **argv; } -void add_diskest(disk, amdevice, level, spindle, prog, options) -char *disk, *amdevice, *prog; +void add_diskest(disk, amdevice, level, spindle, prog, calcprog, options) +char *disk, *amdevice, *prog, *calcprog; int level, spindle; option_t *options; { @@ -471,6 +486,10 @@ option_t *options; newp->amdevice = stralloc(amdevice); newp->dirname = amname_to_dirname(newp->amdevice); newp->program = stralloc(prog); + if(calcprog != NULL) + newp->calcprog = stralloc(calcprog); + else + newp->calcprog = NULL; newp->spindle = spindle; newp->est[level].needestimate = 1; newp->options = options; @@ -535,7 +554,13 @@ disk_estimates_t *est; gnutar_calc_estimates(est); else #endif - generic_calc_estimates(est); +#ifdef SAMBA_CLIENT + if (est->amdevice[0] == '/' && est->amdevice[1] == '/') + dbprintf(("%s: Can't use CALCSIZE for samba estimate: %s %s\n", + est->amname, est->dirname)); + else +#endif + generic_calc_estimates(est); dbprintf(("%s: done with amname '%s', dirname '%s', spindle %d\n", debug_prefix_time(NULL), @@ -545,65 +570,111 @@ disk_estimates_t *est; void generic_calc_estimates(est) disk_estimates_t *est; { + int pipefd = -1, nullfd = -1; char *cmd; - char *argv[DUMP_LEVELS*2+10]; + char *my_argv[DUMP_LEVELS*2+20]; char number[NUM_STR_SIZE]; - int i, level, argc, calcpid; + int i, level, my_argc, calcpid; + int nb_exclude = 0; + int nb_include = 0; + char *file_exclude = NULL; + char *file_include = NULL; + times_t start_time; + FILE *dumpout = NULL; + long size = 1; + char *line = NULL; + char *match_expr; cmd = vstralloc(libexecdir, "/", "calcsize", versionsuffix(), NULL); - argc = 0; - argv[argc++] = stralloc("calcsize"); - argv[argc++] = stralloc(est->program); -#ifdef BUILTIN_EXCLUDE_SUPPORT - if(est->exclude && *est->exclude) { - argv[argc++] = stralloc("-X"); - argv[argc++] = stralloc(est->exclude); + my_argc = 0; + my_argv[my_argc++] = stralloc("calcsize"); + my_argv[my_argc++] = stralloc(est->calcprog); + + my_argv[my_argc++] = stralloc(est->amname); + my_argv[my_argc++] = stralloc(est->dirname); + + + if(est->options->exclude_file) + nb_exclude += est->options->exclude_file->nb_element; + if(est->options->exclude_list) + nb_exclude += est->options->exclude_list->nb_element; + if(est->options->include_file) + nb_include += est->options->include_file->nb_element; + if(est->options->include_list) + nb_include += est->options->include_list->nb_element; + + if(nb_exclude > 0) + file_exclude = build_exclude(est->amname, est->amdevice,est->options,0); + if(nb_include > 0) + file_include = build_include(est->amname, est->amdevice,est->options,0); + + if(file_exclude) { + my_argv[my_argc++] = stralloc("-X"); + my_argv[my_argc++] = file_exclude; + } + + if(file_include) { + my_argv[my_argc++] = stralloc("-I"); + my_argv[my_argc++] = file_include; } -#endif - argv[argc++] = stralloc(est->amdevice); - argv[argc++] = stralloc(est->dirname); - dbprintf(("%s: running cmd: %s", debug_prefix_time(NULL), argv[0])); - for(i=0; iest[level].needestimate) { ap_snprintf(number, sizeof(number), "%d", level); - argv[argc++] = stralloc(number); + my_argv[my_argc++] = stralloc(number); dbprintf((" %s", number)); ap_snprintf(number, sizeof(number), "%ld", (long)est->est[level].dumpsince); - argv[argc++] = stralloc(number); + my_argv[my_argc++] = stralloc(number); dbprintf((" %s", number)); } } - argv[argc] = NULL; + my_argv[my_argc] = NULL; dbprintf(("\n")); fflush(stderr); fflush(stdout); - switch(calcpid = fork()) { - case -1: - error("%s: fork returned: %s", cmd, strerror(errno)); - default: - break; - case 0: - execve(cmd, argv, safe_env()); - error("%s: execve returned: %s", cmd, strerror(errno)); - exit(1); - } - for(i = 0; i < argc; i++) { - amfree(argv[i]); - } + nullfd = open("/dev/null", O_RDWR); + calcpid = pipespawnv(cmd, STDERR_PIPE, &nullfd, &nullfd, &pipefd, my_argv); amfree(cmd); + dumpout = fdopen(pipefd,"r"); + match_expr = vstralloc(est->amname," %d SIZE %ld", NULL); + for(size = -1; (line = agets(dumpout)) != NULL; free(line)) { + if(sscanf(line, match_expr, &level, &size) == 2) { + printf("%s\n", line); /* write to amandad */ + dbprintf(("%s: estimate size for %s level %d: %ld KB\n", + debug_prefix(NULL), + est->amname, + level, + size)); + } + } + amfree(match_expr); + dbprintf(("%s: waiting for %s \"%s\" child\n", - debug_prefix_time(NULL), argv[0], est->amdevice)); + debug_prefix_time(NULL), my_argv[0], est->amdevice)); wait(NULL); dbprintf(("%s: after %s \"%s\" wait\n", - debug_prefix_time(NULL), argv[0], est->amdevice)); + debug_prefix_time(NULL), my_argv[0], est->amdevice)); + + dbprintf(("%s: .....\n", debug_prefix_time(NULL))); + dbprintf(("%s: estimate time for %s: %s\n", + debug_prefix(NULL), + est->amname, + walltime_str(timessub(curclock(), start_time)))); + + for(i = 0; i < my_argc; i++) { + amfree(my_argv[i]); + } + amfree(cmd); } diff --git a/common-src/alloc.c b/common-src/alloc.c index 07bab02..ce5d1b3 100644 --- a/common-src/alloc.c +++ b/common-src/alloc.c @@ -24,7 +24,7 @@ * file named AUTHORS, in the root directory of this distribution. */ /* - * $Id: alloc.c,v 1.17.2.1.4.3.2.3 2002/10/27 14:31:18 martinea Exp $ + * $Id: alloc.c,v 1.17.2.1.4.3.2.3.2.1 2004/08/31 12:46:06 martinea Exp $ * * Memory allocators with error handling. If the allocation fails, * errordump() is called, relieving the caller from checking the return @@ -439,6 +439,9 @@ safe_env() { static char *safe_env_list[] = { "TZ", +#ifdef __CYGWIN__ + "SYSTEMROOT", +#endif #ifdef NEED_PATH_ENV "PATH", #endif diff --git a/common-src/amanda.h b/common-src/amanda.h index 74be276..3d27dbc 100644 --- a/common-src/amanda.h +++ b/common-src/amanda.h @@ -24,7 +24,7 @@ * file named AUTHORS, in the root directory of this distribution. */ /* - * $Id: amanda.h,v 1.66.2.7.4.5.2.14 2004/04/30 12:13:20 martinea Exp $ + * $Id: amanda.h,v 1.66.2.7.4.5.2.12.2.4 2004/08/02 18:56:32 martinea Exp $ * * the central header file included by all amanda sources */ @@ -173,18 +173,7 @@ # include #endif -#ifdef WAIT_USES_UNION - typedef union wait amwait_t; -# ifndef WEXITSTATUS -# define WEXITSTATUS(stat_val) (((amwait_t*)&(stat_val))->w_retcode) -# endif -# ifndef WTERMSIG -# define WTERMSIG(stat_val) (((amwait_t*)&(stat_val))->w_termsig) -# endif -# ifndef WIFEXITED -# define WIFEXITED(stat_val) (WTERMSIG(stat_val) == 0) -# endif -#else +#ifdef WAIT_USES_INT typedef int amwait_t; # ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) (*(unsigned*)&(stat_val) >> 8) @@ -195,6 +184,30 @@ # ifndef WIFEXITED # define WIFEXITED(stat_val) ((*(unsigned*)&(stat_val) & 255) == 0) # endif +#else +# ifdef WAIT_USES_UNION + typedef union wait amwait_t; +# ifndef WEXITSTATUS +# define WEXITSTATUS(stat_val) (((amwait_t*)&(stat_val))->w_retcode) +# endif +# ifndef WTERMSIG +# define WTERMSIG(stat_val) (((amwait_t*)&(stat_val))->w_termsig) +# endif +# ifndef WIFEXITED +# define WIFEXITED(stat_val) (WTERMSIG(stat_val) == 0) +# endif +# else + typedef int amwait_t; +# ifndef WEXITSTATUS +# define WEXITSTATUS(stat_val) (*(unsigned*)&(stat_val) >> 8) +# endif +# ifndef WTERMSIG +# define WTERMSIG(stat_val) (*(unsigned*)&(stat_val) & 0x7F) +# endif +# ifndef WIFEXITED +# define WIFEXITED(stat_val) ((*(unsigned*)&(stat_val) & 255) == 0) +# endif +# endif #endif #ifdef HAVE_UNISTD_H @@ -226,6 +239,7 @@ #include #include #include + #if !defined(CONFIGURE_TEST) # include "amanda-int.h" #endif @@ -534,6 +548,8 @@ extern char *clean_regex P((char *regex)); extern int match P((char *regex, char *str)); extern int match_glob P((char *glob, char *str)); extern char *glob_to_regex P((char *glob)); +extern int match_tar P((char *glob, char *str)); +extern char *tar_to_regex P((char *glob)); extern int match_host P((char *glob, char *host)); extern int match_disk P((char *glob, char *disk)); extern int match_datestamp P((char *dateexp, char *datestamp)); diff --git a/common-src/amfeatures.c b/common-src/amfeatures.c index 7305793..63dcea3 100644 --- a/common-src/amfeatures.c +++ b/common-src/amfeatures.c @@ -25,7 +25,7 @@ */ /* - * $Id: amfeatures.c,v 1.1.2.9 2003/01/01 23:28:52 martinea Exp $ + * $Id: amfeatures.c,v 1.1.2.9.2.3 2004/08/11 19:16:28 martinea Exp $ * * Feature test related code. */ @@ -108,6 +108,10 @@ am_init_feature_set() am_add_feature(f, fe_amidxtaped_header); am_add_feature(f, fe_amidxtaped_nargs); am_add_feature(f, fe_amidxtaped_config); + + am_add_feature(f, fe_partial_estimate); + am_add_feature(f, fe_calcsize_estimate); + am_add_feature(f, fe_selfcheck_calcsize); } return f; } diff --git a/common-src/amfeatures.h b/common-src/amfeatures.h index b665f2b..645f283 100644 --- a/common-src/amfeatures.h +++ b/common-src/amfeatures.h @@ -25,7 +25,7 @@ */ /* - * $Id: amfeatures.h,v 1.1.2.6 2002/11/07 02:12:58 martinea Exp $ + * $Id: amfeatures.h,v 1.1.2.6.2.3 2004/08/11 19:16:28 martinea Exp $ * * Define feature test related items. */ @@ -134,6 +134,10 @@ typedef enum { fe_amidxtaped_nargs, fe_amidxtaped_config, + fe_partial_estimate, + fe_calcsize_estimate, + fe_selfcheck_calcsize, + /* * All new features must be inserted immediately *before* this entry. */ diff --git a/common-src/match.c b/common-src/match.c index 6f94ab4..f26fce2 100644 --- a/common-src/match.c +++ b/common-src/match.c @@ -24,7 +24,7 @@ * file named AUTHORS, in the root directory of this distribution. */ /* - * $Id: match.c,v 1.10.4.1.4.1.2.4 2002/11/12 18:01:19 martinea Exp $ + * $Id: match.c,v 1.10.4.1.4.1.2.4.2.2 2004/12/21 14:20:20 martinea Exp $ * * functions for checking and matching regular expressions */ @@ -125,14 +125,12 @@ char *glob, *str; if((result = regcomp(®c, regex, REG_EXTENDED|REG_NOSUB|REG_NEWLINE)) != 0) { regerror(result, ®c, errmsg, sizeof(errmsg)); - amfree(regex); error("glob \"%s\" -> regex \"%s\": %s", glob, regex, errmsg); } if((result = regexec(®c, str, 0, 0, 0)) != 0 && result != REG_NOMATCH) { regerror(result, ®c, errmsg, sizeof(errmsg)); - amfree(regex); error("glob \"%s\" -> regex \"%s\": %s", glob, regex, errmsg); } @@ -218,6 +216,109 @@ char *glob; } +int match_tar(glob, str) +char *glob, *str; +{ + char *regex = NULL; + regex_t regc; + int result; + char errmsg[STR_SIZE]; + + regex = tar_to_regex(glob); + if((result = regcomp(®c, regex, + REG_EXTENDED|REG_NOSUB|REG_NEWLINE)) != 0) { + regerror(result, ®c, errmsg, sizeof(errmsg)); + error("glob \"%s\" -> regex \"%s\": %s", glob, regex, errmsg); + } + + if((result = regexec(®c, str, 0, 0, 0)) != 0 + && result != REG_NOMATCH) { + regerror(result, ®c, errmsg, sizeof(errmsg)); + error("glob \"%s\" -> regex \"%s\": %s", glob, regex, errmsg); + } + + regfree(®c); + amfree(regex); + + return result == 0; +} + +char *tar_to_regex(glob) +char *glob; +{ + char *regex; + char *r; + size_t len; + int ch; + int last_ch; + + /* + * Allocate an area to convert into. The worst case is a five to + * one expansion. + */ + len = strlen(glob); + regex = alloc(1 + len * 5 + 1 + 1); + + /* + * Do the conversion: + * + * ? -> [^/] + * * -> .* + * [!...] -> [^...] + * + * The following are given a leading backslash to protect them + * unless they already have a backslash: + * + * ( ) { } + . ^ $ | + * + * Put a leading ^ and trailing $ around the result. If the last + * non-escaped character is \ leave the $ off to cause a syntax + * error when the regex is compiled. + */ + + r = regex; + *r++ = '^'; + last_ch = '\0'; + for (ch = *glob++; ch != '\0'; last_ch = ch, ch = *glob++) { + if (last_ch == '\\') { + *r++ = ch; + ch = '\0'; /* so last_ch != '\\' next time */ + } else if (last_ch == '[' && ch == '!') { + *r++ = '^'; + } else if (ch == '\\') { + *r++ = ch; + } else if (ch == '*') { + *r++ = '.'; + *r++ = '*'; + } else if (ch == '?') { + *r++ = '['; + *r++ = '^'; + *r++ = '/'; + *r++ = ']'; + } else if (ch == '(' + || ch == ')' + || ch == '{' + || ch == '}' + || ch == '+' + || ch == '.' + || ch == '^' + || ch == '$' + || ch == '|') { + *r++ = '\\'; + *r++ = ch; + } else { + *r++ = ch; + } + } + if (last_ch != '\\') { + *r++ = '$'; + } + *r = '\0'; + + return regex; +} + + int match_word(glob, word, separator) char *glob, *word; char separator; diff --git a/common-src/protocol.c b/common-src/protocol.c index 0e464ef..e7fe142 100644 --- a/common-src/protocol.c +++ b/common-src/protocol.c @@ -24,7 +24,7 @@ * file named AUTHORS, in the root directory of this distribution. */ /* - * $Id: protocol.c,v 1.27.2.1.6.3 2004/04/14 13:24:35 martinea Exp $ + * $Id: protocol.c,v 1.27.2.1.6.2.2.2 2004/04/14 13:24:17 martinea Exp $ * * implements amanda protocol */ @@ -140,6 +140,7 @@ pktype_t s; case P_BOGUS: return "P_BOGUS"; case P_REQ: return "P_REQ"; case P_REP: return "P_REP"; + case P_PREP: return "P_PREP"; case P_ACK: return "P_ACK"; case P_NAK: return "P_NAK"; default: @@ -510,6 +511,7 @@ pkt_t *pkt; if(strcmp(typestr, "REQ") == 0) pkt->type = P_REQ; else if(strcmp(typestr, "REP") == 0) pkt->type = P_REP; + else if(strcmp(typestr, "PREP") == 0) pkt->type = P_PREP; else if(strcmp(typestr, "ACK") == 0) pkt->type = P_ACK; else if(strcmp(typestr, "NAK") == 0) pkt->type = P_NAK; else pkt->type = P_BOGUS; @@ -738,6 +740,11 @@ pkt_t *pkt; p->state = S_REPWAIT; break; } + else if(pkt->type == P_PREP) { + /* no ack, just rep */ + p->state = S_REPWAIT; + break; + } /* else unexpected packet, put back on queue */ pending_enqueue(p); return; @@ -764,18 +771,26 @@ pkt_t *pkt; else if(action != A_RCVDATA) goto badaction; /* got the packet with the right handle, now check it */ - if(pkt->type != P_REP) { + if(pkt->type != P_REP && pkt->type != P_PREP) { + pending_enqueue(p); + return; + } + if(pkt->type == P_REP) { + send_ack(p); + p->state = S_SUCCEEDED; + free_handle(p); + p->continuation(p, pkt); + amfree(p->req); + amfree(p->security); + amfree(p); + return; + } + else if(pkt->type == P_PREP) { + p->state = S_REPWAIT; + p->continuation(p, pkt); pending_enqueue(p); return; } - send_ack(p); - p->state = S_SUCCEEDED; - free_handle(p); - p->continuation(p, pkt); - amfree(p->req); - amfree(p->security); - amfree(p); - return; default: badaction: @@ -936,7 +951,6 @@ static void handle_incoming_packet() if(errno == EAGAIN) return; #endif - fprintf(stderr,"protocol packet receive: %s\n", strerror(errno)); } diff --git a/common-src/protocol.h b/common-src/protocol.h index 2900ec4..6fd886b 100644 --- a/common-src/protocol.h +++ b/common-src/protocol.h @@ -24,7 +24,7 @@ * file named AUTHORS, in the root directory of this distribution. */ /* - * $Id: protocol.h,v 1.8.10.3 2004/04/29 20:47:40 martinea Exp $ + * $Id: protocol.h,v 1.8.10.2.2.2 2004/04/29 20:47:22 martinea Exp $ * * interfaces for amanda protocol */ @@ -41,7 +41,7 @@ typedef enum { typedef enum { A_BOGUS, A_START, A_TIMEOUT, A_RCVDATA } action_t; -typedef enum { P_BOGUS, P_REQ, P_REP, P_ACK, P_NAK } pktype_t; +typedef enum { P_BOGUS, P_REQ, P_REP, P_PREP, P_ACK, P_NAK } pktype_t; typedef struct { /* a predigested datagram */ pktype_t type; diff --git a/common-src/security.c b/common-src/security.c index 018e7a2..a651b4b 100644 --- a/common-src/security.c +++ b/common-src/security.c @@ -24,7 +24,7 @@ * file named AUTHORS, in the root directory of this distribution. */ /* - * $Id: security.c,v 1.17.2.6.4.1.2.6 2004/04/29 20:47:40 martinea Exp $ + * $Id: security.c,v 1.17.2.6.4.1.2.5.2.1 2004/04/29 20:47:22 martinea Exp $ * * wrapper file for kerberos security */ diff --git a/common-src/sl.c b/common-src/sl.c index a9f37ad..e023cdb 100644 --- a/common-src/sl.c +++ b/common-src/sl.c @@ -25,7 +25,7 @@ * University of Maryland at College Park */ /* - * $Id: sl.c,v 1.1.2.3 2004/04/23 11:44:57 martinea Exp $ + * $Id: sl.c,v 1.1.2.2.2.1 2004/04/23 11:44:51 martinea Exp $ * * A doubly linked list of string (char *) */ diff --git a/common-src/sl.h b/common-src/sl.h index f5e75fb..5ab0e6e 100644 --- a/common-src/sl.h +++ b/common-src/sl.h @@ -25,7 +25,7 @@ * University of Maryland at College Park */ /* - * $Id: sl.h,v 1.1.2.2 2004/04/23 11:44:57 martinea Exp $ + * $Id: sl.h,v 1.1.2.1.2.1 2004/04/23 11:44:51 martinea Exp $ * * A doubly linked list of string (char *) */ diff --git a/common-src/version.c b/common-src/version.c index 442d438..7a56416 100644 --- a/common-src/version.c +++ b/common-src/version.c @@ -1,8 +1,8 @@ /* version.c - generated by genversion.c - DO NOT EDIT! */ char *version_info[] = { - "build: VERSION=\"Amanda-2.4.4p3\"\n", - " BUILT_DATE=\"Tue Jun 22 08:43:12 EDT 2004\"\n", - " BUILT_MACH=\"Linux minifee.iro.umontreal.ca 2.4.20-31.9 #1 Tue Apr 13 18:04:23 EDT 2004 i686 i686 i386 GNU/Linux\"\n", + "build: VERSION=\"Amanda-2.4.5\"\n", + " BUILT_DATE=\"Wed Apr 20 13:40:34 EDT 2005\"\n", + " BUILT_MACH=\"Linux minifee.iro.umontreal.ca 2.6.10-1.771_FC2 #1 Mon Mar 28 00:50:14 EST 2005 i686 i686 i386 GNU/Linux\"\n", " CC=\"gcc\"\n", " CONFIGURE_COMMAND=\"'./configure' '--prefix=/u/martinea/linux' '--with-configdir=/u/martinea/etc/amanda' '--with-gnutar-listdir=/var/gnutar-lists' '--with-gnutar=/usr/local/amanda/bin/tar' '--with-bsd-security' '--with-user=amanda' '--with-group=amandag' '--disable-shared' '--mandir=/u/martinea/man'\"\n", "paths: bindir=\"/u/martinea/linux/bin\"\n", @@ -16,9 +16,9 @@ char *version_info[] = { " XFSDUMP=UNDEF XFSRESTORE=UNDEF VXDUMP=UNDEF VXRESTORE=UNDEF\n", " SAMBA_CLIENT=\"/usr/bin/smbclient\"\n", " GNUTAR=\"/usr/local/amanda/bin/tar\"\n", - " COMPRESS_PATH=\"/bin/gzip\" UNCOMPRESS_PATH=\"/bin/gzip\"\n", - " LPRCMD=\"/usr/bin/lpr\" MAILER=\"/usr/bin/Mail\"\n", - " listed_incr_dir=\"/var/gnutar-lists\"\n", + " COMPRESS_PATH=\"/usr/bin/gzip\"\n", + " UNCOMPRESS_PATH=\"/usr/bin/gzip\" LPRCMD=\"/usr/bin/lpr\"\n", + " MAILER=\"/usr/bin/Mail\" listed_incr_dir=\"/var/gnutar-lists\"\n", "defs: DEFAULT_SERVER=\"minifee.iro.umontreal.ca\"\n", " DEFAULT_CONFIG=\"DailySet1\"\n", " DEFAULT_TAPE_SERVER=\"minifee.iro.umontreal.ca\"\n", diff --git a/common-src/versuff.c b/common-src/versuff.c index ff22961..c4d0813 100644 --- a/common-src/versuff.c +++ b/common-src/versuff.c @@ -33,8 +33,8 @@ const int VERSION_MAJOR = 2; const int VERSION_MINOR = 4; -const int VERSION_PATCH = 4; -const char *const VERSION_COMMENT = "p3"; +const int VERSION_PATCH = 5; +const char *const VERSION_COMMENT = ""; char * versionsuffix() diff --git a/config/acinclude.m4i b/config/acinclude.m4i index bcc2712..bbb5fcd 100644 --- a/config/acinclude.m4i +++ b/config/acinclude.m4i @@ -439,7 +439,33 @@ if test $cf_cv_arg_union_wait = yes; then AC_DEFINE(WAIT_USES_UNION,1,[Defined if wait() puts the status in a union wait instead of int. ]) fi ])dnl +AC_DEFUN([CF_WAIT_INT], +[ +AC_REQUIRE([AC_TYPE_PID_T]) +AC_HAVE_HEADERS(sys/wait.h wait.h) +AC_CACHE_CHECK([whether wait uses int], [cf_cv_arg_int], + [AC_TRY_COMPILE([ +#include +#if HAVE_SYS_WAIT_H +# include +#else +# if HAVE_WAIT_H +# include +# endif +#endif + +#ifdef __STDC__ +pid_t wait(int *); +#endif +], [ + int x; int i; + wait(&x); i = WIFEXITED(x) +], [cf_cv_arg_int=yes], [cf_cv_arg_int=no])]) +if test $cf_cv_arg_int = yes; then + AC_DEFINE(WAIT_USES_INT,1,[Defined if wait() puts the status in a int instead of a union wait. ]) +fi +])dnl dnl @synopsis AX_CREATE_STDINT_H [( HEADER-TO-GENERATE [, HEDERS-TO-CHECK])] dnl @@ -473,7 +499,7 @@ dnl Remember, if the system already had a valid , the generated dnl file will include it directly. No need for fuzzy HAVE_STDINT_H things... dnl dnl @, (status: used on new platforms) (see http://ac-archive.sf.net/gstdint/) -dnl @version $Id: acinclude.m4i,v 1.1.2.5.6.2 2004/04/29 20:47:40 martinea Exp $ +dnl @version $Id: acinclude.m4i,v 1.1.2.5.8.3 2004/04/29 20:47:22 martinea Exp $ dnl @author Guido Draheim AC_DEFUN([AX_CREATE_STDINT_H], diff --git a/config/config.h.in b/config/config.h.in index b8a365c..3959454 100644 --- a/config/config.h.in +++ b/config/config.h.in @@ -1207,6 +1207,9 @@ * other hosts where the Veritas filesystem (vxfs) has been installed. */ #undef VXRESTORE +/* Defined if wait() puts the status in a int instead of a union wait. */ +#undef WAIT_USES_INT + /* Defined if wait() puts the status in a union wait instead of int. */ #undef WAIT_USES_UNION diff --git a/config/install-sh b/config/install-sh index e9de238..e4160c9 100755 --- a/config/install-sh +++ b/config/install-sh @@ -1,19 +1,38 @@ #!/bin/sh -# # install - install a program, script, or datafile -# This comes from X11R5 (mit/util/scripts/install.sh). + +scriptversion=2004-04-01.17 + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: # -# Copyright 1991 by the Massachusetts Institute of Technology +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. # -# Permission to use, copy, modify, distribute, and sell this software and its -# documentation for any purpose is hereby granted without fee, provided that -# the above copyright notice appear in all copies and that both that -# copyright notice and this permission notice appear in supporting -# documentation, and that the name of M.I.T. not be used in advertising or -# publicity pertaining to distribution of the software without specific, -# written prior permission. M.I.T. makes no representations about the -# suitability of this software for any purpose. It is provided "as is" -# without express or implied warranty. +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it @@ -23,13 +42,11 @@ # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. - # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" - # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" @@ -41,211 +58,268 @@ stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" -transformbasename="" -transform_arg="" +transformbasename= +transform_arg= instcmd="$mvprog" chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" +chowncmd= +chgrpcmd= +stripcmd= rmcmd="$rmprog -f" mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd="$cpprog" - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd="$stripprog" - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac +src= +dst= +dir_arg= + +usage="Usage: $0 [OPTION]... SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 -d DIRECTORIES... + +In the first form, install SRCFILE to DSTFILE, removing SRCFILE by default. +In the second, create the directory path DIR. + +Options: +-b=TRANSFORMBASENAME +-c copy source (using $cpprog) instead of moving (using $mvprog). +-d create directories instead of installing files. +-g GROUP $chgrp installed files to GROUP. +-m MODE $chmod installed files to MODE. +-o USER $chown installed files to USER. +-s strip installed files (using $stripprog). +-t=TRANSFORM +--help display this help and exit. +--version display version info and exit. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG +" + +while test -n "$1"; do + case $1 in + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + -c) instcmd=$cpprog + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + --help) echo "$usage"; exit 0;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -s) stripcmd=$stripprog + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + --version) echo "$0 $scriptversion"; exit 0;; + + *) # When -d is used, all remaining arguments are directories to create. + test -n "$dir_arg" && break + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dstarg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dstarg" + shift # fnord + fi + shift # arg + dstarg=$arg + done + break;; + esac done -if [ x"$src" = x ] -then - echo "install: no input file specified" - exit 1 -else - true -fi - -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d $dst ]; then - instcmd=: - chmodcmd="" - else - instcmd=mkdir - fi -else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f $src -o -d $src ] - then - true - else - echo "install: $src does not exist" - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "install: no destination specified" - exit 1 - else - true - fi - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - - if [ -d $dst ] - then - dst="$dst"/`basename $src` - else - true - fi +if test -z "$1"; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call `install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 fi -## this sed command emulates the dirname command -dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script - -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' -' -IFS="${IFS-${defaultIFS}}" - -oIFS="${IFS}" -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS="${oIFS}" - -pathcomp='' - -while [ $# -ne 0 ] ; do - pathcomp="${pathcomp}${1}" - shift - - if [ ! -d "${pathcomp}" ] ; - then - $mkdirprog "${pathcomp}" - else - true - fi +for src +do + # Protect names starting with `-'. + case $src in + -*) src=./$src ;; + esac + + if test -n "$dir_arg"; then + dst=$src + src= + + if test -d "$dst"; then + instcmd=: + chmodcmd= + else + instcmd=$mkdirprog + fi + else + # Waiting for this to be detected by the "$instcmd $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dstarg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + + dst=$dstarg + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst ;; + esac - pathcomp="${pathcomp}/" + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + dst=$dst/`basename "$src"` + fi + fi + + # This sed command emulates the dirname command. + dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + + # Make sure that the destination directory exists. + + # Skip lots of stat calls in the usual case. + if test ! -d "$dstdir"; then + defaultIFS=' + ' + IFS="${IFS-$defaultIFS}" + + oIFS=$IFS + # Some sh's can't handle IFS=/ for some reason. + IFS='%' + set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` + IFS=$oIFS + + pathcomp= + + while test $# -ne 0 ; do + pathcomp=$pathcomp$1 + shift + if test ! -d "$pathcomp"; then + $mkdirprog "$pathcomp" || lasterr=$? + # mkdir can fail with a `File exist' error in case several + # install-sh are creating the directory concurrently. This + # is OK. + test ! -d "$pathcomp" && { (exit ${lasterr-1}); exit; } + fi + pathcomp=$pathcomp/ + done + fi + + if test -n "$dir_arg"; then + $doit $instcmd "$dst" \ + && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ + && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ + && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } + + else + # If we're going to rename the final executable, determine the name now. + if test -z "$transformarg"; then + dstfile=`basename "$dst"` + else + dstfile=`basename "$dst" $transformbasename \ + | sed $transformarg`$transformbasename + fi + + # don't allow the sed command to completely eliminate the filename. + test -z "$dstfile" && dstfile=`basename "$dst"` + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0 + trap '(exit $?); exit' 1 2 13 15 + + # Move or copy the file name to the temp name + $doit $instcmd "$src" "$dsttmp" && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $instcmd $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ + && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ + && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && + + # Now rename the file to the real destination. + { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ + || { + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + if test -f "$dstdir/$dstfile"; then + $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ + || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ + || { + echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 + (exit 1); exit + } + else + : + fi + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" + } + } + fi || { (exit 1); exit; } done -fi - -if [ x"$dir_arg" != x ] -then - $doit $instcmd $dst && - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi -else - -# If we're going to rename the final executable, determine the name now. - - if [ x"$transformarg" = x ] - then - dstfile=`basename $dst` - else - dstfile=`basename $dst $transformbasename | - sed $transformarg`$transformbasename - fi - -# don't allow the sed command to completely eliminate the filename - - if [ x"$dstfile" = x ] - then - dstfile=`basename $dst` - else - true - fi - -# Make a temp file name in the proper directory. - - dsttmp=$dstdir/#inst.$$# - -# Move or copy the file name to the temp name - - $doit $instcmd $src $dsttmp && - - trap "rm -f ${dsttmp}" 0 && - -# and set any options; do chmod last to preserve setuid bits - -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && - -# Now rename the file to the real destination. - - $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile - -fi && - -exit 0 +# The final little trick to "correctly" pass the exit status to the exit trap. +{ + (exit 0); exit +} + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/configure b/configure index a35cca4..f49a1df 100755 --- a/configure +++ b/configure @@ -1947,7 +1947,7 @@ fi # Define the identity of the package. PACKAGE=amanda - VERSION=2.4.4p3 + VERSION=2.4.5 cat >>confdefs.h <<_ACEOF @@ -27418,6 +27418,237 @@ _ACEOF fi + + + + +for ac_header in sys/wait.h wait.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +echo "$as_me:$LINENO: checking whether wait uses int" >&5 +echo $ECHO_N "checking whether wait uses int... $ECHO_C" >&6 +if test "${cf_cv_arg_int+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include + +#if HAVE_SYS_WAIT_H +# include +#else +# if HAVE_WAIT_H +# include +# endif +#endif + +#ifdef __STDC__ +pid_t wait(int *); +#endif + +int +main () +{ + + int x; int i; + wait(&x); i = WIFEXITED(x) + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_arg_int=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cf_cv_arg_int=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $cf_cv_arg_int" >&5 +echo "${ECHO_T}$cf_cv_arg_int" >&6 +if test $cf_cv_arg_int = yes; then + +cat >>confdefs.h <<\_ACEOF +#define WAIT_USES_INT 1 +_ACEOF + +fi + echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 if test "${ac_cv_header_time+set}" = set; then @@ -49070,7 +49301,7 @@ LTLIBOBJS=`echo "$LIBOBJS" | LTALLOCA=`echo "$ALLOCA" | sed 's/\.'"${ac_objext}"'/\.lo/g'` - ac_config_files="$ac_config_files amplot/amcat.awk amplot/amplot.sh amplot/Makefile changer-src/chg-manual.sh changer-src/chg-multi.sh changer-src/chg-mtx.sh changer-src/chg-chs.sh changer-src/chg-rth.pl changer-src/chg-chio.pl changer-src/chg-zd-mtx.sh changer-src/Makefile changer-src/chg-juke.sh changer-src/chg-rait.sh changer-src/chg-null.sh changer-src/chg-mcutil.sh changer-src/chg-disk.sh changer-src/chg-iomega.pl client-src/patch-system.sh client-src/Makefile common-src/versuff.c common-src/Makefile example/amanda.conf example/Makefile example/amanda.conf.chg-scsi example/chg-scsi-linux.conf example/chg-scsi-solaris.conf example/chg-scsi-hpux.conf example/chg-mcutil.conf man/amadmin.8 man/amanda.8 man/amcheck.8 man/amcheckdb.8 man/amcleanup.8 man/amdump.8 man/amflush.8 man/amlabel.8 man/amoverview.8 man/amrecover.8 man/amrmtape.8 man/amtoc.8 man/amverify.8 man/Makefile man/amstatus.8 man/amreport.8 man/amgetconf.8 man/amverifyrun.8 man/amtapetype.8 docs/Makefile recover-src/Makefile restore-src/Makefile server-src/amcheckdb.sh server-src/amcleanup.sh server-src/amdump.sh server-src/amfreetapes.sh server-src/amoverview.pl server-src/amrmtape.sh server-src/amtoc.pl server-src/amverify.sh server-src/Makefile server-src/amstatus.pl server-src/amverifyrun.sh tape-src/Makefile config/Makefile Makefile" + ac_config_files="$ac_config_files amplot/amcat.awk amplot/amplot.sh amplot/Makefile changer-src/chg-manual.sh changer-src/chg-multi.sh changer-src/chg-mtx.sh changer-src/chg-chs.sh changer-src/chg-rth.pl changer-src/chg-chio.pl changer-src/chg-zd-mtx.sh changer-src/Makefile changer-src/chg-juke.sh changer-src/chg-rait.sh changer-src/chg-null.sh changer-src/chg-mcutil.sh changer-src/chg-disk.sh changer-src/chg-iomega.pl client-src/patch-system.sh client-src/Makefile common-src/versuff.c common-src/Makefile example/amanda.conf example/Makefile example/amanda.conf.chg-scsi example/chg-scsi-linux.conf example/chg-scsi-solaris.conf example/chg-scsi-hpux.conf example/chg-mcutil.conf man/Makefile docs/Makefile recover-src/Makefile restore-src/Makefile server-src/amcheckdb.sh server-src/amcleanup.sh server-src/amdump.sh server-src/amfreetapes.sh server-src/amoverview.pl server-src/amrmtape.sh server-src/amtoc.pl server-src/amverify.sh server-src/Makefile server-src/amstatus.pl server-src/amverifyrun.sh tape-src/Makefile config/Makefile Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -49751,25 +49982,7 @@ do "example/chg-scsi-solaris.conf" ) CONFIG_FILES="$CONFIG_FILES example/chg-scsi-solaris.conf" ;; "example/chg-scsi-hpux.conf" ) CONFIG_FILES="$CONFIG_FILES example/chg-scsi-hpux.conf" ;; "example/chg-mcutil.conf" ) CONFIG_FILES="$CONFIG_FILES example/chg-mcutil.conf" ;; - "man/amadmin.8" ) CONFIG_FILES="$CONFIG_FILES man/amadmin.8" ;; - "man/amanda.8" ) CONFIG_FILES="$CONFIG_FILES man/amanda.8" ;; - "man/amcheck.8" ) CONFIG_FILES="$CONFIG_FILES man/amcheck.8" ;; - "man/amcheckdb.8" ) CONFIG_FILES="$CONFIG_FILES man/amcheckdb.8" ;; - "man/amcleanup.8" ) CONFIG_FILES="$CONFIG_FILES man/amcleanup.8" ;; - "man/amdump.8" ) CONFIG_FILES="$CONFIG_FILES man/amdump.8" ;; - "man/amflush.8" ) CONFIG_FILES="$CONFIG_FILES man/amflush.8" ;; - "man/amlabel.8" ) CONFIG_FILES="$CONFIG_FILES man/amlabel.8" ;; - "man/amoverview.8" ) CONFIG_FILES="$CONFIG_FILES man/amoverview.8" ;; - "man/amrecover.8" ) CONFIG_FILES="$CONFIG_FILES man/amrecover.8" ;; - "man/amrmtape.8" ) CONFIG_FILES="$CONFIG_FILES man/amrmtape.8" ;; - "man/amtoc.8" ) CONFIG_FILES="$CONFIG_FILES man/amtoc.8" ;; - "man/amverify.8" ) CONFIG_FILES="$CONFIG_FILES man/amverify.8" ;; "man/Makefile" ) CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; - "man/amstatus.8" ) CONFIG_FILES="$CONFIG_FILES man/amstatus.8" ;; - "man/amreport.8" ) CONFIG_FILES="$CONFIG_FILES man/amreport.8" ;; - "man/amgetconf.8" ) CONFIG_FILES="$CONFIG_FILES man/amgetconf.8" ;; - "man/amverifyrun.8" ) CONFIG_FILES="$CONFIG_FILES man/amverifyrun.8" ;; - "man/amtapetype.8" ) CONFIG_FILES="$CONFIG_FILES man/amtapetype.8" ;; "docs/Makefile" ) CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;; "recover-src/Makefile" ) CONFIG_FILES="$CONFIG_FILES recover-src/Makefile" ;; "restore-src/Makefile" ) CONFIG_FILES="$CONFIG_FILES restore-src/Makefile" ;; diff --git a/configure.in b/configure.in index 850c2ef..e3ee866 100644 --- a/configure.in +++ b/configure.in @@ -14,10 +14,10 @@ AC_DEFINE_UNQUOTED(CONFIGURE_COMMAND,"$CONFIGURE_COMMAND", [Saves the original ./configure command line arguments]) AC_SUBST(CONFIGURE_COMMAND) -AM_INIT_AUTOMAKE(amanda, 2.4.4p3) +AM_INIT_AUTOMAKE(amanda, 2.4.5) AM_CONFIG_HEADER(config/config.h) -AC_PREREQ(2.57) dnl Minimum Autoconf version required. +AC_PREREQ(2.59) dnl Minimum Autoconf version required. if test -f "$srcdir/SNAPSHOT"; then cat < "$srcdir/SNAPSHOT" @@ -1654,6 +1654,7 @@ dnl Checks for header files. AC_HEADER_STDC AC_HEADER_DIRENT CF_WAIT +CF_WAIT_INT AC_HEADER_TIME AC_CHECK_HEADERS(\ arpa/inet.h \ @@ -2795,16 +2796,7 @@ AC_CONFIG_FILES([\ example/chg-scsi-solaris.conf example/chg-scsi-hpux.conf \ example/chg-mcutil.conf \ \ - man/amadmin.8 man/amanda.8 \ - man/amcheck.8 man/amcheckdb.8 \ - man/amcleanup.8 man/amdump.8 \ - man/amflush.8 man/amlabel.8 \ - man/amoverview.8 man/amrecover.8 \ - man/amrmtape.8 man/amtoc.8 \ - man/amverify.8 man/Makefile \ - man/amstatus.8 man/amreport.8 \ - man/amgetconf.8 man/amverifyrun.8 \ - man/amtapetype.8 \ + man/Makefile \ \ docs/Makefile \ \ diff --git a/docs/DUMPER-API b/docs/DUMPER-API deleted file mode 100644 index 2438a51..0000000 --- a/docs/DUMPER-API +++ /dev/null @@ -1,392 +0,0 @@ -AMANDA DUMPER API - -Last modified $Date: 1998/10/06 17:17:00 $ - -by Alexandre Oliva - -1. INTRODUCTION - -This is a proposal of a mechanism for Amanda to support arbitrary -backup programs, that relies on a generic backup driver and scripts or -programs that interface with backup programs such as dump, tar, -smbclient, and others. It can also be used to introduce pre- and -post-backup commands. - -The interface is simple, but supports everything that is currently -supported by Amanda, and it can be consistently extended to support -new abstractions that may be introduced in the backup driver in the -future. - -This proposal does not imply any modification in the Amanda protocol -or in Amanda servers; only Amanda clients have to be modified. By -Amanda clients, we refer to hosts whose disks are to be backed up; -an Amanda server is a host connected to a tape unit. - -Currently (as of release 2.4.1 of Amanda), Amanda clients support -three operations: selfcheck, estimate and backup. - -Selfcheck is used by the server program amcheck, to check whether a -client is responding or if there are configuration or permission -problems in the client that might prevent the backup from taking -place. - -Estimates are requested by the Amanda planner, that runs on the server -and collects information about the expected sizes of backups of each -disk at several levels. Given this information and the amount of -available tape space, the planner can select which disks and which -levels it should tell dumper to run. - -Dumper is yet another server-side program; it requests clients to -perform dumps, as determined by planner, and stores these dumps in -holding disks or sends them directly to the taper program. The -interaction between dumper and taper is beyond the scope of this text. - -We are going to focus on the interaction between the Amanda client -program and wrappers of dump programs. These wrappers must implement -the DUMPER API. The dumptype option `program' should name the wrapper -that will be used to back up filesystems of that dumptype. One -wrapper may call another, so as to extend its functionality. - -2. THE PROBLEM - -Different backup programs present distinct requirements; some must be -run as super-user, whereas others can be run under other user-ids. -Some require a directory name, the root of the tree to be backed up; -others prefer a raw device name; some don't even refer to local disks -(SAMBA). Some wrappers may need to know a filesystem type in order to -decide which particular backup program to use (dump, vdump, vxdump, -xfsdump, backup). - -Some provide special options for estimates, whereas others must be -started as if a complete dump were to be performed, and must be killed -as soon as they print an estimate. - -Furthermore, the output formats of these backup programs vary wildly. -Some will print estimates and total sizes in bytes, in 512-byte tape -blocks units, in Kbytes, Mbytes, Gbytes, and possibly Tbytes in the -near future. Some will print a timestamp for the backup; some won't. - -There are also restrictions related with possible scheduling policies. -For example, some backup programs only support full backups or -incrementals based on the last full backup (0-1). Some support full -backups or incrementals based on the last backup, be it a full or an -incremental backup (0-inf++). Some support incrementals based on a -timestamp (incr/date); whereas others are based on a limited number of -incremental levels, but incrementals of the same level can be -repeated, such as dump (0-9). - -Amanda was originally built upon DUMP incremental levels, so this is -the only model it currently supports. Backup programs that use other -incremental management mechanisms had to be adapted to this policy. -Wrapper scripts are responsible for this adaptation. - -Another important issue has to do with index generation. Some backup -programs can generate indexes, but each one lists files in its own -particular format, but they must be stored in a common format, so that -the Amanda server can manipulate them. - -The DUMPER API must accomodate for all these variations. - -3. OVERVIEW OF THE API - -We are going to define a standard format of argument lists that the -backup driver will provide to wrapper programs, and the expected -result of the execution of these wrappers. - -The first argument to a wrapper should always be a command name. If -no arguments are given, or an unsupported command is requested, an -error message should be printed to stderr, and the program should -terminate with exit status 1. - -3.1. The `support' command - -As a general mechanism for Amanda to probe for features provided by a -backup program, a wrapper script must support at least the `support' -command. Some features must be supported, and Amanda won't ever ask -about them. Others will be considered as extensions, and Amanda will -ask the wrapper whether they are supported before issuing the -corresponding commands. - -3.1.1. The `level-incrementals' subcommand - -For example, before requesting for an incremental backup of a given -level, Amanda should ask the wrapper whether the backup program -supports level-based incrementals. We don't currently support backup -programs that don't, but we may in the future, so it would be nice if -wrappers already implemented the command `support level-incrementals', -by returning a 0 exit status, printing, say, the maximum incremental -level it supports, i.e., 9. A sample session would be: - -% /usr/local/amanda/libexec/wrappers/DUMP support level-incrementals hda0 -9 - -Note that the result of this support command may depend on filesystem -information, so the disklist filesystem entry should be specified as a -command line argument. In the next examples, we are not going to use -full pathnames to wrapper scripts any more. - -We could have defined a `support' command for full backups, but I -can't think of a backup program that does not support full backups... - -3.1.2. The `index' subcommand - -The ability to produce index files is also subject to an invocation of -`support' command. When the support sub-command is `index', like in -the invocation below, the wrapper must print a list of valid indexing -mechanisms, one per line, most preferred first. If indexing is not -supported, nothing should be printed, and the exit status should be 1. - - DUMP support index hda0 - -The currently known indexing mechanisms are: - -output: implies that the command `index-from-output' generates an -index file from the output produced by the backup program (for -example, from `tar -cv'). - -image: implies that the command `index-from-image' generates an index -file from a backup image (for example, `tar -t'). - -direct: implies that the `backup' command can produce an index file as -it generates the backup image. - -parse: implies that the `backup-parse' command can produce an index -file as it generates the backup formatted output . - -The indexing mechanisms will be explicitly requested with the additionnal -option `index-' in the `backup' and `backup-parse' command invocation. - -`index-from-image' should be supported, if possible, even if other -index commands are not, since it can be used in the future to create -index files from previously backed up filesystems. - -3.1.3. The `parse-estimate' subcommand - -The `parse-estimate' support subcommand print a list of valid mechanisms to -parse the estimate output and write the estimate size to its output, the -two mechanisms are: - -direct: implies that the `estimate' command can produce the estimate output. - -parse: implies that the `estimate-parse' command can produce the estimate -output when fed with the `estimate' output. - -The estimate parsing mechanisms will be explicitly requested with the -additionnal option `estimate-' in the `estimate' and -`estimate-parse' command invocation. - -3.1.4. The `parse-backup' subcommand - -The `parse-backup' support subcommand print a list of valid mechanisms to -parse the backup stderr, the two mechanisms are: - -direct: implies that the `backup' command can produce the -backup-formatted-ouput. - -parse: implies that the `backup-parse' command can produce the -backup-formatted-ouput when fed with the `backup' stderr. - -The backup parsing mechanisms will be explicitly requested with the -additionnal option `backup-' in the `backup' and `backup-parse' -command invocation. - -3.1.5. Others subcommands - -Some other standard `support' sub-commands are `exclude' and -`exclude-list'. - -3.1.6. - -One may think (and several people did :-) that there should be only -one support command, that would print information about all supported -commands. The main arguments against this proposal have to do with -extensibility: - -1) the availability of commands might vary from filesystem to -filesystem. No, I don't have an example, I just want to keep it as -open as possible :-) - -2) one support subcommand may require command line arguments that -others don't, and we can't know in advance what these command line -arguments are going to be - -3) the output format and exit status conventions of a support command -may vary from command to command; the only pre-defined convention is -that, if a wrapper does not know about a support subcommand, it should -return exit status 1, implying that the inquired feature is not -supported. - -3.2. The `selfcheck' command - -We should support commands to perform self-checks, run estimates, -backups and restores (for future extensions of the Amanda protocol -so as to support restores) - -A selfcheck request would go like this: - - DUMP selfcheck hda0 option option=value ... - -The options specified as command-line arguments are dumptype options -enabled for that disk, such as `index', `norecord', etc. Unknown -options should be ignored. For each successful check, a message such -as: - -OK [/dev/hda0 is readable] -OK [/usr/sbin/dump is executable] - -Errors should be printed as: - -ERROR [/etc/dumpdates is not writable] - -If selfcheck needs super-user (or some other user, for that matter) -access to perform some tests, it should print to the standard output -either: - -USER root -GROUP operator - -The backup driver should then arrange to re-run the script as the -specified user/group. Security concerns may impose restrictions on -privileges that can be given to wrapper scripts. For example, we may -require that, in order to run a wrapper script as any other user or -group, the wrapper script must be in a separate directory, say -/usr/local/amanda/libexec/wrappers-protected, and that the script, its -containing directory and all its parents must only be writable by -root. - -The need for starting programs as other users requires amandad (that -will incorporate all the functionality from selfcheck, sendsize and -sendbackup) to be setuid-root. However, it will fork a child process -and drop to the amanda user privileges as soon as possible. This -child process will be driven through a pipe, and it will be able to -start services as other users, in a way that no other user, not even -the backup operator, will be able to run arbitrary commands. - - -A wrapper script will certainly have to figure out either the disk -device name or its mount point, given a filesystem name such as -`hda0', as specified in the disklist. In order to help these scripts, -Amanda provides a helper program that can guess device names, mount -points and filesystem types, when given disklist entries. - -The filesystem type can be useful on some operation systems, in which -more than one dump program is available; this information can help -automatically selecting the appropriate dump program. - - -The exit status of selfcheck and of this alternate script are probably -going to be disregarded. Anyway, for consistency, selfcheck should -return exit status 0 for complete success, 1 if any failures have -occurred and 2 if it needs additional permissions (USER/GROUP). Note -that, if the wrapper needs a special permission to perform a test, it -should not report a failure for that test. - -3.3. The `estimate' and `estimate-parse' commands - -Estimate requests can be on several different forms. An estimate of a -full backup may be requested, or estimates for level- or -timestamp-based incrementals: - - DUMP estimate full hda0 option ... - DUMP estimate level 1 hda0 option ... - DUMP estimate diff 1998:09:24:01:02:03 hda0 option ... - - -If the backup program needs privileged access to obtain estimates, it -should just print: - -USER root -GROUP operator - -and exit, with exit status 2. If requested estimate type is not -supported, exit status 3 should be returned. - -If the option `estimate-direct' is set, then the `estimate' command -should write to stdout the estimated size, in bytes, a pair of numbers -that, multiplied by one another, yield the estimated size in bytes. - -If the option `estimate-parse' is set, then the `estimate' command -should write to stdout the informations needed by the -`estimate-parse' command, that should extract from its input the -estimated size. - -The syntax of `estimate-parse' is identical to that of `estimate'. - -Both `estimate' and `estimate-parse' can output the word `KILL', after -printing the estimate. In this case, Amanda will send a SIGTERM -signal to the process group of the `estimate' process. If it does not -die within a few seconds, a SIGKILL will be issued. - -If `estimate' or `estimate-parse' succeed, they should exit 0, -otherwise exit 1, except for the already listed cases of exit status 2 -and 3. - -3.4. The `backup' and `backup-parse' commands - -The syntax of `backup' is the same as that of `estimate'. The backup -image should be written to standard output, whereas stderr should be -used for the user-oriented output of the backup program and other -messages. - -If the option `backup-direct' is set, then the `backup' command should -write to stderr a formatted-output-backup. - -If the option `backup-parse' is set, then the `backup' command -should write to stderr the informations needed by the `backup-parse' -command, that should edit its input so that it prints to standard -output a formatted-output-backup. - -If the option `no-record' is set, then the `backup' command should -not modify its state file (ex. dump should not modify /etc/dumpdates). - -The syntax of `backup-parse' is identical to that of `backup'. - -The syntax of the formatted-output-backup is as follow: -All lines should start with either `| ' for normal output, `? ' for -strange output or `& ' for error output. If the wrapper can determine -the total backup size from the output of the backup program, it should -print a line starting with `# ', followed by the total backup size in -bytes or by a pair of numbers that, multiplied, yield the total backup -size; this number will be used for consistency check. - -The option `index-direct' should cause commands `backup' to output -the index directly to file descriptor 3. The option `index-parse' -should cause commands `backup-parse' to output the index directly to -file descriptor 3. The syntax of the index file is described in the -next section. - -3.5. The `index-from-output' and `index-from-image' commands - -The syntax of the `index-from-output' and `index-from-image' commands -is identical to the one of `backup'. They are fed the backup output -or image, and they must produce a list of files and directories, one -per line, to the standard output. Directories must be identified by -the `/' termination. - -After the file name and a blank space, any additional information -about the file or directory, such as permission data, size, etc, can -be added. For this reason, blanks and backslashes within filenames -should be quoted with backslashes. Linefeeds should be represented as -`\n', although it is not always possible to distinguish linefeeds in -the middle of filenames from ones that separate one file from another, -in the output of, say `restore -t'. It is not clear whether we should -also support quoting mechanisms such as `\xHH', `\OOO' or `\uXXXX'. - -3.6. The `restore' command - -Yet to be specified. - -3.7. The `print-command' command - -This command must be followed by a valid backup or restore command, -and it should print a shell-command that would produce an equivalent -result, i.e., that would perform the backup to standard output, or -that would restore the whole filesystem reading from standard input. -This command is to be included in the header of backup images, to ease -crash-recovery. - -4. Conclusion - -Well, that's all. Drop us a note at the amanda-hackers mailing list -if you have suggestions to improve this document and/or the API. Some -help on its implementation would be welcome too. diff --git a/docs/EXCLUDE b/docs/EXCLUDE deleted file mode 100644 index 0e6d81d..0000000 --- a/docs/EXCLUDE +++ /dev/null @@ -1,317 +0,0 @@ -============ -Introduction -============ - -There are times when data needs to be excluded from a backup. When -these times arise be confident that Amanda has this capability. -(Actually it's not Amanda, it's tar.) There are three ways of -excluding data in an Amanda backup: - - * Exclude an individual item explicitly in the dumptype - * Utilize an Exclude List - * Do not include the data in the disklist - -This document is based on Amanda 2.4.2 and some of this might not -work with older versions. This was compiled from my personal -experience and with help from the members of the amanda-users -mailing list when I was originally setting this up, to whom I wish -to thank for all of their support. - -============ -Please Read -============ - -As far as I am able to tell the only way to exclude files or -directories with Amanda is to use gnutar as the dump program -(others?). The file system dump programs provided with unix systems -(e.g. dump, ufsdump) get data at a raw drive level and generally -do not allow exclusion of specific files or directories. - -The GNU version of tar, (gnutar or gtar), reads its data at a -file system, (or higher), level and does include the option to -exclude specific files and/or directories. It should be mentioned -here that tar will change the access times on files. Tar has the -ability to preserve the access times however, doing so effectively -disables incremental backups since resetting the access time alters -the inode change time, which in turn causes the file to look like -it needs to be archived again. - -The only exception that I am aware of is to just not include the -data in question in the disklist. This option may not be suitable -for everyone's needs and can confuse the issue some, so I have -elected to include this mechanism in its own section named "Do not -include the data in the disklist". - -For the purpose of this document an Amanda backup configuration -named "exclude-test" will be used. The machine that contains the -tape drive which receives data to be archived will be referred to -as "SERVER". The machine that data is being archived from will be -referred to as "CLIENT". These two systems are usually different -machines but are not required to be, and may be the same machine. -Parts of this setup are on the server and some are on the client. - -*************** -** IMPORTANT ** -*************** - -When Amanda attempts to exclude a file or directory it does so -relative to the area being archived. For example if "/var" is in -your disklist and want to exclude "/var/log/somefile", then your -exclude file would contain "./log/somefile". You may use one -exclude file in multiple dump types without any restriction. - -=============== -Before We Begin -=============== - -The first step that should be taken is to verify that backups are -currently working. Connect to SERVER and run amcheck as your Amanda -user, to verify that there are no errors in the current setup. - - $ amcheck -cl CLIENT - -Output should look something like below for success: - - Amanda Tape Server Host Check - ----------------------------- - - /path/to/holding-disk: 4771300 KB disk space available, that's plenty. - Amanda Backup Client Hosts Check - -------------------------------- - Client check: 1 host checked in 0.084 seconds, 0 problems found. - -Next make sure that gnutar is the dump program currently in use. -The easiest way to tell if your dumptype is using gnutar is to run -the following: - - $ amadmin exclude-test disklist CLIENT - -Among all the output is the "program" value currently in use. This -value is also specified with the "program" option in the dumptype. -If the dumptype has the line "program GNUTAR" your setup should ready -to exclude data. - -If gnutar is not in use add the line "program GNUTAR" to the -dumptype, and then run amcheck again to verify that backups should -work. The capitalization of GNUTAR is required in the current -version of amanda. - -The dumptype should look something like: - -define dumptype exclude-test { - comment "test dumptype for documentation" - priority high - program "GNUTAR" -} - -============================= -Choosing an exclude mechanism -============================= - -If the need is to exclude only one file or directory then the -easiest way to accomplish this is to exclude an individual item -explicitly in the dumptype. If the need is to exclude multiple -files or directories then use an Exclude List. - -================== -Exclude Mechanisms -================== - -** Exclude an individual item explicitly in the dumptype ** - -The easiest way to exclude a file or directory is to specify it -with the "exclude" option in the dumptype. This option accepts an -argument of the file or directory to be excluded. Amanda allows -only one exclude option in any dumptype at a time. Any path -specified to be excluded must be encapsulated with quotes. Continuing -with our example from above "/var/log/somefile" and using the same -dumptype as above, the dumptype would now look like: - -define dumptype exclude-test { - comment "test dumptype for documentation" - priority high - program "GNUTAR" - exclude "./log/somefile" -} - -Next run amcheck again to verify that there are no problems with -the revised Amanda configuration. If the data is not being excluded -as expected please see the Troubleshooting section below. This -completes the setup of excluding an individual item in the dumptype. - - -** Utilize an Exclude List ** - -An exclude list is a file that resides on the CLIENT machine and -contains paths to be excluded, one per line. This file can be in -any location on the CLIENT so long as the same path is specified -in the dumptype. Some find /usr/local/etc/amanda an appropriate -location, but it is up to you. I personally like to have a -subdirectory for exclude files but it is up to you where you place -this file. - -The exclude file may also be placed in the area being archived. -This is an easy way to have a different exclusion file for each -disklist entry without needing separate dumptype definitions. To -use this technique, enter a path relative to the area being archived -as the exclude file below instead of an absolute path. - -Connect to CLIENT and create the exclude directory as root. For -example: - - $ mkdir -p /usr/local/etc/amanda/exclude - $ cd /usr/local/etc/amanda/exclude - -Next create the exclude list for Amanda to use. You can name the -exclude file anything you wish it to be. Create a file, and in -this file place all paths to files and directories that are to be -excluded. Keeping with the /var example, assume that -/var/log/XFree86.0.log, and /var/log/maillog need to be excluded. -Remember that all paths are relative. The exclude list would look -like: - - ./log/XFree86.0.log - ./log/maillog - -Make sure that permissions are restricted on this file. Run the -following as root, where exclude-filename is the name of the file -you just created. For example: - - $ chmod 644 /usr/local/etc/amanda/exclude/exclude-filename - -This concludes the necessary configuration on the client. - -Connect to SERVER and cd to the exclude-test Amanda configuration -directory. Edit the Amanda configuration file e.g. amanda.conf. -Add an entry similar to the following line, to the dumptype for -the client in question, where the exclude-filename is the file that -was created on CLIENT in the step above including the quotes. -For example: - - exclude list "/usr/local/etc/amanda/exclude/exclude-filename" - -The new dumptype should look something like: - - define dumptype exclude-test{ - comment "test dumptype for documentation" - priority high - program "GNUTAR" - exclude list "/usr/local/etc/amanda/exclude/exclude-filename" - } - -Save the file. Run amcheck again to verify that there are no problems -with the revised Amanda configuration. If amcheck succeeds then -run amdump to verify the data is being excluded correctly. If the -data is not being excluded as expected please see the Troubleshooting -section below. This completes the setup of an exclude list. - -** Do not include the data in the disklist ** - -Amanda uses disklist entries to define which directories or partitions -should be archived. This allows us to exclude data by just not -placing the data in question in the disklist. Assume that there -is a disk mounted on /example. The directory /example has five -subdirectories "a", "b", "c", "d", and "e". The directories "a", -"b", and "c" need to be archived, while "d" and "e" should not. -This can be accomplished by not specifying "d" and "e" in the -disklist. Using the same dumptype and host in the above examples -the disklist would contain: - - CLIENT /examples/a exclude-test - CLIENT /examples/b exclude-test - CLIENT /examples/c exclude-test - -Run amcheck to verify that Amanda is working correctly. If the -data is not being excluded as expected please see the Troubleshooting -section below. This completes the setup of using a disklist to -exclude data. - -========= -Expresion -========= - -Quiz: what is the difference between the following entries in -an exclude list? - -1 ./foo -2 ./foo/ -3 ./foo/* - -case 1 directory ./foo won't be in the backup image (that's what you want) -case 2 matches nothing (don't use it) -case 3 directory ./foo will be in the backup image but nothing below it. - -================== -Wildcard Expansion -================== - -Amanda has the ability to use wildcard expansion while excluding -data as implemented by tar(1). The only places that wildcard -expansion is allowed is in the "exclude" option in the dumptype, -or in the exclude list. Some simple examples: - -Exclude any file or directory that ends in ".log" e.g. ppp.log, -XFree86.0.log - - ./*.log - -Exclude any file or directory with the string "log" e.g. logfile, -maillog, syslog, ppp.log, XFree86.0.log - - */*log* - -Exclude any file or directory that starts with string "cron" and ends in -".gz" e.g. cron.1.gz, cron.2.gz, log/cron.1.gz - - ./*cron*.gz - -The question mark can be used to specify a single character. e.g. -log.1, log.2, etc - - ./log.? - -=============== -Troubleshooting -=============== - -1. If you find that you are having trouble getting the exclude -patterns to match correctly, check out this really cool script -written by John R. Jackson. - - ftp://gandalf.cc.purdue.edu/pub/amanda/gtartest-exclude - -This script allows you to test your patterns before placing them -in an exclude list or in the dumptype. Instructions on how to run -the script are included in the script. - -2. Broken gnutar? There are versions of gnutar that do not correctly -exclude data. Version 1.12 (plus the Amanda patches from -www.amanda.org) are known to work correctly, as does version 1.13.19 -(and later). Anything else is questionable. - -3. The ps command is your friend. Connect to CLIENT and run a "ps -ax | grep tar", (ps -ef | grep tar) on Solaris, to see exactly how -the tar command is running. Look in the output for the --exclude -or --exclude-from options in the running tar process. For example: - - $ ps ax | grep tar - 11078 ? R 0:37 /bin/tar --create --directory /var - --listed-incremental /var/lib/amanda/gnutar-lists/CLIENTvar_0.new - --sparse --one-file-system --ignore-failed-read --totals --file - /dev/null --exclude-from=/usr/local/etc/amanda/exclude-test/exclude.var - . - -In the above output notice the string "--exclude-from=". The string -following the "=" is the exclude file currently in use. If the -string was "--exclude" then the string following the "=" is the -file or directory that is currently set to be excluded. - -4. Check out the book "Unix Backup & Recovery", written by W. Cutris -Preston. It contains a chapter on Amanda written by John R. Jackson. -It can be read online at www.amanda.org. - -5. Contact the amanda-users mailing list. Subscription information -is available at www.amanda.org. - - -Written by Andrew Hall August 6, 2001. diff --git a/docs/FAQ b/docs/FAQ deleted file mode 100644 index 148a872..0000000 --- a/docs/FAQ +++ /dev/null @@ -1,525 +0,0 @@ -This file contains answers to some questions that are frequently asked -in the Amanda mailing lists, specially by new users. Please take a -look at this file before posting, this can save us time that could be -spent improving Amanda and its documentation. - -New entries and modifications are welcome; send them to -amanda-users@amanda.org or amanda-hackers@amanda.org. - -You may also want to take a look at the Amanda FAQ-O-Matic -http://www.amanda.org/fom-serve/cache/1.html - - -Q: Why does Amanda fail to build on my system? - -A: One of the most common reasons for compile-time errors is stale -information in `config.cache', after a build on a different platform -using the same build tree. In order to avoid this problem, make sure -you don't ever reuse build trees across platforms, or at least run -`make distclean' before running `configure' on another platform. - - Another common reason for failure, that causes link-time errors, is -a problem in libtool that causes it to search for symbols in -already-installed amanda libraries, instead of in the just-built ones. -This problem is known to affect SunOS 4.1.3 and FreeBSD. You can -usually work around it by specifying a different prefix when you -configure the new version of Amanda. However, it may not work if the -previous version of Amanda was installed in /usr/local and gcc -searches this directory by default; in this case, you must either -remove the old libraries (which you don't want to do, right? :-) or -call configure with the flag --disable-libtool. In this case, Amanda -won't create shared libraries, so binaries will be larger, but you may -worry about that later. - - You may also want to take a look at docs/SYSTEM.NOTES, as well as -to the Amanda Patches Page (check www.amanda.org) for other known -problems. If everything fails, you should read the manual, but since -we don't have one yet, just post a help request to the amanda-users -mailing list, showing the last few lines of the failed build. - - -Q: Why does `amdump' report that all disks failed? - -A: Probably because the Amanda clients are not properly configured. -Before you ever run `amdump', make sure `amcheck' succeeds. When it -does, so should `amdump'. - - Make sure you run `amcheck' as the same user that is supposed to -start `amdump', otherwise you may get incorrect results. - - -Q: Why does `amcheck' say `port NNN is not secure'? - -A: Because `amcheck', as some other Amanda programs, must be installed -as setuid-root. Run `make install' as `root', or `chown' all Amanda -setuid programs to `root', then `chmod u+s' them again, if `chown' -drops the setuid bit. - - -Q: Why does `amcheck' claim that the tape is `not an amanda tape'? - -A: Because Amanda requires you to label tapes before it uses them. -Run `amlabel' in order to label a tape. - - If, even after labeling a tape, `amcheck' still complains about it, -make sure the regular expression specified in amanda.conf matches the -label you have specified, and check whether you have configured -non-rewinding tape devices for Amanda to use. For example, use -/dev/nrst0 instead of /dev/rst0, /dev/rmt/0bn instead of /dev/rmt/0b, -or some other system-dependent device name that contains an `n', -instead of one that does not. The `n' stands for non-rewinding. - - If you have labeled any tapes using the rewiding device -configuration, you'll have to label them again. - - -Q: Why does `amcheck' report `selfcheck request timed out'? - -A: This can occur under several different situations. First, make -sure this problem is repeatable; if Amanda programs are -NFS-auto-mounted, some clients may fail to mount the Amanda binaries -in time. - - If the error is repeatable, log into the client, and check whether -the directory /tmp/amanda exists, and a file named amandad.debug -exists in there: amandad will create this file whenever it starts. If -this file does not exist, amandad is not starting properly, or it -lacks permission to create /tmp/amanda/amandad.debug. - - In the latter case, wipe out /tmp/amanda, and amandad should create -it next time it runs. In the former case, check your inetd -configuration. Make sure you have added the Amanda services to -/etc/services (or the NIS services map), that /etc/inetd.conf was -properly configured, and that you have signalled inetd to reread this -file (some systems may need rebooting). Check section 2.2 from the -INSTALL file for details. Check the inetd man-page for possible -differences between the standard inetd.conf format and the one in your -system. - - Pay special attention to typos in inetd.conf; error messages will -probably appear in /var/adm/messages or /var/log/messages if you have -typed the amandad program name incorrectly. Make sure the same user -that you have specified at configure-time (--with-user=) is -listed in inetd.conf. Check whether this user has permission to run -amandad, as well as any shared libraries amandad depends upon, by -running the specified amandad command by hand, as the Amanda user. It -should just time-out after 30 seconds waiting for a UDP packet. If -you type anything, it will abort immediately, because it can't read a -UDP packet from the keyboard. - - As soon as you have properly configured inetd.conf so as to run -amandad, you should no longer get the `selfcheck request timed out' -message. A nice tool to help make sure inetd is really listening on -the amandad port is lsof, available at -ftp://vic.cc.purdue.edu/pub/tools/unix/lsof. - - -Q: Why does `amandad.debug' contain `error receiving message'? - -A: One possibility is that you have run `amandad' from the command -line prompt and typed anything instead of waiting for it to time-out: -in this case, it will try to read a UDP packet from the keyboard, and -this was reported not to work on most keyboards :-). However, if you -have run `amandad' as any user other than the one listed in -`inetd.conf', it may have created a /tmp/amanda directory that the -Amanda user cannot write to, so you should wipe it out. - - Another possibility is that the Amanda service was not properly -configured as a UDP service; check /etc/services and /etc/inetd.conf. - - -Q: Why does `amcheck' say `access as not allowed...' - -A: There must be something wrong with .amandahosts configuration (or -.rhosts, if you have configured --without-amandahosts). - - First, if the is not what you expect (i.e., not what you -have specified in the --with-user flag, at configure time), check the -inetd configuration file: you must have specified the wrong username -there. - - Make sure you specify the names exactly as they appear in the error -message after the `@' sign in .amandahosts/.rhosts. You'll need a -fully-qualified domain name or not, depending on how your client -resolves IP addresses to host names. - - -Q: Why does `amcheck' report `ip address #.#.#.# is not in the ip list -list for '? - -A: Check your DNS configuration tables. In order to avoid -DNS-spoofing, Amanda double-checks hostname<->IP address mapping. If -the IP address the request comes from maps to a hostname, but this -hostname does not map back to the incoming IP address, the request is -denied. - - -Q: Why does `amcheck' say `cannot overwrite active tape'? - -A: Because, if you configure Amanda to use N tapes, by setting -tapecycle to N in `amanda.conf', before Amanda overwrites a tape, it -must write to at least other N-1 tapes. Of course, Amanda will always -refuse to overwrite a tape marked for `noreuse' with `amadmin'. -Furthermore, such tapes are not counted when Amanda computes `N-1' -tapes. - - If, for some reason, you want to tell Amanda to overwrite a -particular tape, regardless of its position in the cycle, use -`amrmtape'. This command will remove this tape from the `tapelist' -file, that is used to manage the tape cycle, and will delete -information about backups stored in that tape from the Amanda -database. - - -Q: Why does `amcheck' tell me `DUMP program not available'? - -A: Because the `configure' could not find DUMP when it was first run. -This is a common problem on Linux hosts, because most Linux -distributions do not install DUMP by default. - - If you don't have a DUMP program installed, install it, remove -`config.cache', run `configure' again and rebuild Amanda. While -`configure' is running, make sure it can find the installed DUMP -program. If it cannot, you may have to set the environment variables -DUMP and RESTORE by hand, before running configure. - - If you can't or don't want to install DUMP, you may use GNU tar, -but make sure it as release 1.12 or newer; release 1.11.8 may work, -but estimates will be slow as hell. - - -Q: Which tape changer configuration should I use in amanda.conf? - -A: If you only have one tape unit, you have two choices: (i) don't use -a tape changer at all, i.e., set runtapes to 1, set tapedev to the -non-rewinding device corresponding to the tape unit, and comment out -tpchanger, changerfile and changerdev; or (ii) set up chg-manual, so -that you can change tapes manually. If you select chg-manual, you -will not be able to start `amdump' as a cron job, and you should -always run `amflush -f', because chg-manual will ask you to press -return in the terminal where you started the controlling program. - - If you have several tape units, which you want to use to emulate a -tape changer, you want chg-multi. Even if you do own a real tape -changer, that operates based on ejecting a tape or such, chg-multi may -be useful. - - Actual tape changers usually require specialized changer programs, -such as `mtx', `chio' or specific system calls. The availability of -these programs is much more dependent on the operating system you're -running than on the particular tape changer hardware you have. - - `mtx', for example, is available for several platforms. However, -even if you find it for your platform, beware that there exist several -different programs named `mtx', that require different command line -arguments, and print different output, and Amanda's chg-mtx does not -support them all. You may have to edit the script, which shouldn't be -hard to do. - - In section BUILT-IN TAPE CHANGERS of docs/TAPE.CHANGERS, you will -find details about the tape changer interfacing programs provided with -Amanda, that can interact with common tape changer programs and with -tape changer-related system calls provided by some operating system. -If none of them matches your needs, you may have to develop your own -tape changer interface script. - - Before posting a question to the Amanda mailing lists, *please* -search the archives, and try to obtain as much information about -driving your tape changer hardware from the vendor of the changer -hardware and of the operating system, rather than from the Amanda -mailing lists. We usually don't have much to say about tape changer -units, and several questions about them remain unanswered. :-( - - Anyway, if you decide to post a question, make sure you specify -both the tape changer hardware *and* the OS/platform that is going to -interface with it. Good luck! :-) - - -Q: Should I use software or hardware compression? - -A: When you enable software compression, you drastically reduce the -compression that might be achieved by hardware. In fact, tape drives -will usually use *more* tape if you tell them to try to further -compress already compressed data. - - Thus, you must choose whether you're going to use software or -hardware compression; don't ever enable both unless you want to waste -tape space. - - Since Amanda prefers to have complete information about tape sizes -and compression rates, it can do a better job if you use software -compression. However, if you can't afford the extra CPU usage, Amanda -can live with the unpredictability of hardware compression, but you'll -have to be very conservative about the specified tape size, specially -if there are filesystems that contain mostly uncompressible data. - - -Q: How can I configure Amanda so that it performs full backups on the -week-end and incrementals on weekdays? - -A: You can't. Amanda doesn't work this way. You just have to tell -Amanda how many tapes you have (tapecycle), and how often you want it -to perform full backups of each filesystem (dumpcycle). If you don't -run it once a daily (including Saturdays and Sundays :-), you'll also -want to tell Amanda how many times you'll run it per dumpcycle -(runspercycle). It will spread full backups along the dumpcycle, so -you won't have any full-only or incremental-only runs. - - -Q: What if my tape unit uses expensive tapes, and I don't want to use -one tape per day? Can't Amanda append to tapes? - -A: It can't, and this is good. Tape drives and OS drivers are -(in)famous for rewinding tapes at unexpected times, without telling -the program that's writing to them. If you have a month's worth of -backups in that tape, you really don't want them to be overwritten, so -Amanda has taken the safe approach of requiring tapes to be written -from the beginning on every run. - - This can be wasteful, specially if you have a small amount of data -to back up, but expensive large-capacity tapes. One possible approach -is to run amdump with tapes only, say once a week, to perform full -backups, and run it without tape on the other days, so that it -performs incremental backups and stores them in the holding disk. -Once or twice a week, you flush all backups in the holding disk to a -single tape. - - If you don't trust your holding disk, and you'd rather have all -your data on tapes daily, you can create an alternate configuration, -with two tapes, that backs up the holding disk only, always as a full -backup. You'd run this configuration always after your regular -backup, so you always have a complete image of the holding disk on -tape, just in case it fails. - - -Q: How can I configure Amanda for long-term archiving? - -A: The best approach is to create a separate configuration for your -archive backups. It should use a separate set of tapes, and have all -dumptypes configured with `record no', so it doesn't interfere with -regular backups. - - -Q: Can I backup separate disks of the same host in different -configurations? - -A: Yes, but you have to be careful. Amanda uses UDP to issue estimate -and backup requests and, although replies to backup requests are -immediate (so that TCP connections for the actual backup can be -established), replies to estimate requests are not and, while one -request is being processed, any other request is ignored. The effect -is two-fold: (i) if another configuration requests for estimates, the -request will be ignored, and the requester will end up timing out; -(ii) if another configuration has already finished the estimates, and -is now requesting for backups, the backup requests will time-out. - - So, there are two easy ways out: (i) ensure that the configurations -never run concurrently, or (ii) set up two different installations of -the Amanda server, using different services names to contact the -clients, i.e., different port numbers. This can be attained with the -configure flag --with-testing=. Yes, the flag name is -not appropriate, but so what? - - If you don't want to set up two installations of Amanda (I agree, -it's overkill), but you still want to back up disks of the same host -in separate configurations, you can set up Amanda so that one -configuration only starts after the first one has already finished its -One possible way to work-around this limitation is to start one -configuration only after you know the estimates for the first one have -already finished (modifying the crontab entries, according to history -data). You'll also have to delay the starttime (a dumptype option) of -the disks in the first configuration, so that they don't start backing -up before the estimates of the second configuration finish. - - -Q: Can Amanda span large filesystems across multiple tapes? - -A: Not yet :-( - - This is an open project, looking for developers. If you'd like to -help, please take a look at the Amanda Ongoing Projects Page, where -more up-to-date information is likely to be found about this project. - - The current work-around is to use GNU tar to back up subdirectories -of the huge filesystem separately. But be aware of the problems -listed in the question about `results missing'. - - -Q: What's the difference between option `skip-full' and `strategy nofull'? - -A: `strategy nofull' is supposed to handle the following situation: -you run a full dump off-line once a millenium :-), because that disk -isn't supposed to change at all and, if it does, changes are minimal. -Amanda will run only level 1 backups of that filesystem, to avoid the -risk of overwriting a level 1 backup needed to do a restore. -Remember, you run full dumps once a millenium, and your tape cycle -probably won't last that long :-) - - `skip-full', OTOH, is supposed to let the user run full dumps -off-line regularly (i.e., as often as specified in the dumpcycle), -while Amanda takes care of the incrementals. Currently, Amanda will -tell you when you're supposed to run the level 0 backups but, if you -fail to do so, Amanda will not only skip a full day's worth of -valuable backups of the filesystem, on the day it told you to the full -backup manually, but it will also run a level 1 backup on the next -day, even if you have not performed the full backup yet. Worse yet: -it might perform a level 2 on the next day, just after you have run -the level 0, so, if the disk should crash, you'd have to restore a -level 0 then a level 2, but not the level 1! Not a real problem, but -definitely strange, eh? - - -Q: Why does `amdump' report `results missing'? - -A: One of the possible reasons is that you have requested too many -backups of the host. In this case, the estimate request or the reply -may not fit in a UDP packet. This will cause Amanda not to perform -some of the backups. Fixing this problem involves modifying the way -estimate requests are issued, so that no packet exceeds the maximum -packet size, and issuing additional requests that did not fit in a UDP -packet after a reply for the previous set is obtained. The -probability of getting this problem has been considerably reduced -since we increased the maximum UDP packet size from 1Kb to 64Kb, but -some operating systems may not support such large packets. - - One possible work-around is to try to shorten the pathnames of the -directories and the exclude file names, so that more requests fit in -the UDP packet. You may create short-named links in some directory -closer to the root (/) so as to reduce the length of names. I.e., -instead of backing up /usr/home/foo and /usr/home/bar, create the -following links: - /.foo -> /usr/home/foo - /.bar -> /usr/home/bar -then list /.foo and /.bar in the disklist. - - Another approach is to group sub-directories in backup sets, -instead of backing up them all separately. For example, create -/usr/home/.bkp1 and move `foo' and `bar' into it, then create links so -that the original pathnames remain functional. Then, list -/usr/home/.bkp1 in the disklist. You may create as many `.bkp' -directories as you need. - - A simpler approach, that may work for you, is to backup only a -subset of the subdirectories of a filesystem separately. The others -can be backed up together with the root of the filesystem, using an -exclude list that prevents duplicate backups. - - -Q: Why does `amdump' report `disk offline'? - -A: Well, assuming the disk is not really off line :-), it may be a -permission problem, but then, `amcheck' would have reported it. - - Another possible reason for this failure is a filesystem error, -that causes DUMP to crash before it estimates the backup size; a -`fsck' may help. - - Yet another possibility is that the filesystem is so large that the -backup program is incorrectly reporting the estimated size, for -example, by printing a negative value that Amanda will not accept as a -valid estimate. If you are using DUMP, contact your vendor and -request a patch for dump that fixes this bug. If you are using GNU -tar, make sure it is release 1.12 or newer; 1.11.8 won't do! Even -release 1.12 may require a patch to correctly report estimates and -dump sizes, as well as to handle sparse files correctly and quickly -instead of printing error messages like `Read error at byte 0, reading -512 bytes, in file ./var/log/lastlog: Bad file number' in -sendsize.debug and being very slow. Check the patches directory of -the Amanda distribution. - - -Q: What if `amdump' reports `dumps way too big, must skip incremental -dumps'? - -A: It means Amanda couldn't back up some disk because it wouldn't fit -in the tape(s) you have configured Amanda to use. It considered -performing some incrementals instead of full dumps, so that all disks -would fit, but this wouldn't be enough, so the disk really had to be -dropped in this run. - - In general, you can just ignore this message if it happens only -once in a while. Low-priority disks are discarded first, so you'll -hardly miss really important data. - - One real work-around is to configure Amanda to use more tapes: -increase `runtapes' in `amanda.conf'. Even if you don't have a real -tape changer, you can act yourself as a changer (`chg-manual'; more -details in the question about tape changer configuration), or use -`chg-multi' with a single tape unit, and lie to Amanda that it will -have two tapes to use. If you have a holding disk as large as a tape, -and configure Amanda (2.4.1b1 or newer) not to reserve any space for -degraded dumps, dumps that would be stored in the second tape of a run -will be performed to the holding disk, so you can flush them to tape -in the morning. - - -Q: `amdump' reported `infofile update failed'. What should I do? - -A: Make sure all directories and files are readable and writable by -the Amanda user, within the directory you specified as `infofile' in -`amanda.conf'. From then on, only run amanda server commands -(amadmin, amdump, amflush, amcleanup) as the Amanda user, not as root. - - -Q: Why does Amanda sometimes promote full dumps? - -A: To spread the full dumps along the dumpcycle, so that daily runs -take roughtly the same amount of tape and time. As soon as you start -using Amanda, it will run full dumps of all filesystems. Then, on the -following runs, it will promote some backups, so as to adjust the -balance. After one or two dumpcycles, it should stop promoting dumps. -You can see how well it is doing with `amadmin balance'. If -you find the results surprising, you may want to adjust dumpcycle or -runspercycle. - - -Q: Why does `amrecover' report `no index records' or `disk not found'? - -A: The most common cause of this problem is not having enabled index -generation in amanda.conf. The `index yes' option must be present in -every dumptype for whose disks indexes should be generated. - - Another possibility is that `amrecover' is not selecting the -configuration name that contains the backups for the selected disk. -You may specify a configuration name with the `-c' switch, when you -invoke `amrecover'. The default configuration name can only be -specified at Amanda configure time (--with-config=). - - Indexes are currently generated at backup-time only, so, if a -backup was performed without creating an index, you won't be able to -use `amrecover' to restore it, you'll have to use `amrestore'. - - -Q: Ok, I'm done with testing Amanda, now I want to put it in -production. How can I reset its databases so as to start from -scratch? - -A: First, remove the `curinfo' database. By default, it is a -directory, but, if you have selected any other database format (don't, -they're deprecated), they may be files with extensions such as .dir -and .pag. - - Then, remove any log files from the log directory: -log.. and amdump.. Finally, remove the -tapelist file, stored in the directory that contains amanda.conf, -unless amanda.conf specifies otherwise. Depending on the tape changer -you have selected, you may also want to reset its state file. - - -Q: The man-page of DUMP says that active filesystems may be backed up -inconsistently. What does Amanda do to prevent inconsistent backups? - -A: Nothing. When you back up an active filesystem, there are two -possibilities: - -1) dump may print strange error messages about invalid blocks, then -fail; in this case, Amanda will retry the backup on the next run - -2) files that are modified while dump runs may be backed up -inconsistently. But then, they will be included in the next -incremental backup, which should usually be enough - - Large, critical files such as databases should be locked somehow, -to avoid inconsistent backups, but there's no direct support for that -in Amanda. The best bet is to configure Amanda to use a wrapper to -DUMP, that locks and unlocks the database when appropriate. diff --git a/docs/HOWTO-AFS b/docs/HOWTO-AFS deleted file mode 100644 index 6255810..0000000 --- a/docs/HOWTO-AFS +++ /dev/null @@ -1,8 +0,0 @@ -You need to download the following package if you want to backup AFS volume -with amanda: - ftp://ftp.ccmr.cornell.edu/pub/amanda-afs/amanda-afs.tar.gz -or - anonymous cvs from :pserver:anonymous@cvs.ccmr.cornell.edu:/usr/common/cvs - and checkout project 'amanda-afs' - -The patch to amanda is already included in this distribution. diff --git a/docs/HOWTO-CYGWIN.html b/docs/HOWTO-CYGWIN.html deleted file mode 100644 index 033c879..0000000 --- a/docs/HOWTO-CYGWIN.html +++ /dev/null @@ -1,240 +0,0 @@ - - - - - Amanda on Cygwin HOWTO - - - - - - -

Amanda on Cygwin HOWTO

-

by Doug Kingston, 30 January 2003.  Based on Cygwin 1.3.18, and -Amanda 2.4.3-20021027 and some fixes which will be in the official -release by the time you see this.
-

-

With thanks to Enrico Bernardini from whom I have borrowed some -material from an earlier attempt at documenting the installation of -Amanda on Cygwin in 2001.  Please send annotations and corrections -to amanda-hackers@amanda.org. I can be reached as dpk (at) -randomnotes.org (do the obvious).
-

-

1. Install Cygwin

-

-

The following Cygwin packages are required for binary installation -(may be incomplete):

-
    -
  • Category BASE: standard
  • -
  • Category MISC: gzip
    -
  • -
  • Category MISC: tar
    -
  • -
  • Category NET: inetutils
  • -
-

You need also these packages to build from source (may be -incomplete):

-
    -
  • Category DEVELOP: ALL
  • -
  • Category INTERPRETERS: m4, gawk ?
  • -
  • Category LIBS:default -selection? (libc, libiconv, others?)
    -
  • -
-I have most or the basic utilities and libraries installed so I cannot -give you a more specific list of what is required.  If someone has -a more definitive list, I would appreciate and email to amanda-hackers.
-
-One user reported some problems with access rights when running under -Cygwin, which he solved by setting the CYGWIN environment variable to -nontsec.  I do not believe this is necessary if you run the amanda -daemon as System (see below).
-

-

2. Other Preparation

-When doing backups on a NT, Windows 2000 or Windows XP system, the -choice of user and group will be important if you are to properly -interact with the security mechanisms of these more modern Microsoft -product.  For Windows 95/98/ME this is probably a non-issue.  -The most privileged account on the Windows systems is 'System', and I -have chosen to use this account for Amanda backups to ensure that I can -access the widest set of files.  On Unix we would run as root, with -equivalent access permissions.  I have also chose to run under the -'Administrators' group, another standard Windows group.  Ensure -these exist before you continue - or identify another account to -use.  The Cygwin installation postinstall script should have -already populated /etc/passwd and /etc/group with these entries.
-
    -
  • Make sure that System (or SYSTEM) has a home directory specified -in /etc/passwd.
  • -
-I used /home/root.  -You'll need to put the .amandahosts file here later.  The relevant -lines from my /etc/passwd file are:
-
SYSTEM:*:18:18:,S-1-5-18:/home/root:
-root:*:18:18:,S-1-5-18:/home/root:
-

3. Compile Amanda

-After installing Cygwin, unpack the Amanda sources, typically in -/usr/src/amanda or something similar.  In the Amanda directory, you -will need to execute:
-
automake  -# this may not be necessary in the official release
-autoconf  # this may not be -necessary in the official release
- 
-./configure --without-server \
-  --without-force-uid \
-  --with-user=yourlogin \
-  --with-group=Administrators
-make
-make       -# yes, I needed to run it a second time
-make install
-
-
-The use of  your own login instead of SYSTEM requires some -explanation.  If you were to call runconfigure with SYSTEM instead -of your own login id as part of the -with-user parameter, the -installation process will fail due to the way Cygwin and the NT/W2K/XP -security system interact.  Once you chown a file to another user -(like SYSTEM) you are no longer able to chgrp or chmod the file.  -The installations process will abort at this point.  By installing -the files owned by yourself, you will be able to chgrp and chmod them -as expected.  Note that you still RUN as SYSTEM from inetd.conf -(see below).
-

4. Configure Cygwin files

-

You have to modify some config files:

-
    -
  • /etc/inetd.conf: cleanup un-needed entries:
  • -
-

Comment out any entries you do not need -by placing a '#' at the start of the lines.  This is just good -practice, and if any of the entries reference non-existent users (e.g. -uucp) inetd may not start up.

-
    -
  • /etc/inetd.conf: add -
    amanda dgram udp wait System -/usr/local/libexec/amandad amandad
    -ATTENTION: Use tabs, don't use spaces.
    -
  • -
-
    -
  • create /home/root/.amandahosts -(or whereever System's home directory is): -
     <amanda server> <amanda user> 
    -
  • -
-Then create the following AMANDA directories and the amandates file: -
mkdir -p /usr/local/var/amanda/gnutar-lists
-
-mkdir /tmp/amanda
-
-touch /etc/amandates
-
-

5. Configure Windows system files

-Update the Windows services list
-
    -
  • <WINDIR>\Services: add -
    amanda 10080/udp # -amanda backup services
    -amandaidx 10082/tcp # amanda backup services
    -amidxtape 10083/tcp # amanda backup services
    -
    -
  • -
-where WINDIR is C:\WINNT\system32\drivers\etc or something -similar.  The last two lines are needed if you want to use -amrecover.
-
-Ensure that the default Windows PATH environment variable include your -Cygwin /bin directory.  This is necessary since inetd and hence the -amandad that it spawns will not have the advantage of being started by -the standard bash shell startup script and won't find the needed dynamic -libraries (e.g. cygwin1.dll). My PATH is:
-
-  -%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\cygwin\bin

-
-This is on XP; My Computer, right click - Properties, click on -Environment Variables (at the bottom).  Yours may vary, but make -sure the Cygwin bin directory is represented somewhere in the PATH.
-

-

6. Configure Inetd to run automatically as a service

-

If you want to test your installation, you can call inetd from bash -prompt:

-
/usr/sbin/inetd -d
-

-

Windows 98/ME
-

-

-
    -
  • To start after the user logs in: Create a shortcut to -
    c:\cygwin\usr\sbin\inetd.exe
    -in -
    <WINDIR>\start menu\programs\startup
    -
  • -
  • To start before the user logs in: Add the string key -
    CygwinInetd=C:\cygwin\usr\sbin\inetd.exe
    -under -
    HKLM\Software\Microsoft\Windows\CurrentVersion\RunServices
    -in the registry. You'll see a dos-like window on the startup: I not -found a solution to iconize or to make invisible (suggestions are -welcome).
  • -
-

Windows NT/2000/XP

-

From bash prompt, type:

-
 /usr/sbin/inetd --install-as-service
-Then, to start/stop inetd service use the Services control panel or the -following Windows command: -
 net start/stop inetd
-

7. Notes on Amanda backup options

-

Compression
-Currently, client side compression does not work, probably due to -problems in pipe emulation in Cygwin.  I have not tried to debug -this yet.  This may be addressed in a subsequent release, or it -could be fixed in later releases of Cygwin.  Due to this issue, we -recommend that if you want compressed dumps from Windows clients, you -configure Amanda for server compression in amanda.conf on your Amanda -server:

-
define -dumptype srv-comp-tar {
-    global
-    comment -"partitions dumped via tar with server compression"
-    program -"GNUTAR"
-    compress -server fast
-    exclude list -".amanda.exclude"
-}
-

Exclude -Lists
-A note on exclude lists is also in order.  If you specify a -relative path, it will be expect ed that the file is in or relative to -the root of the directory you are planning to dump.  Typically this -will not be '/' but '/cygdrive/c' or something similar if you want to -get the Windows files and the Cygwin files.  '/' is taken to be the -root of the Cygwin tree, normally something like C:\cygwin or possibly -C:\Program Files\cygwin.

-

Debugging -Files
-Amanda will leave debugging files in /tmp/amanda if it exists.  I -have recommended creating the directory above. 
-

-


-

- - diff --git a/docs/HOWTO-FILE-DRIVER b/docs/HOWTO-FILE-DRIVER deleted file mode 100644 index 8c8f655..0000000 --- a/docs/HOWTO-FILE-DRIVER +++ /dev/null @@ -1,356 +0,0 @@ ---- - - AMANDA FILE-DRIVER-USAGE HOWTO. - ---- - - This document covers the use of the file-driver in AMANDA - 2.4.3 and higher. Examples given here have been taken from a - SuSe-Linux-8.2-Pro-environment, using AMANDA 2.4.4p1 and the - snapshot 2.4.4p1-20031202. - - Please adjust paths, configuration names and other parameters - to your system. - - Stefan G. Weichinger, November - December, 2003 - ---- - - Since release 2.4.3 AMANDA supports the usage of a output - driver called "file". See the AMANDA-man page, section - OUTPUT DRIVERS, for more information on its implementation. - As the name suggests, this driver uses files as virtual (or file) - tapes. Once created and labeled, these file tapes can be selected - and changed with the standard tape-changer-interface of the AMANDA - server. - ---- - -POSSIBLE USES - ---- - - - test installations. - You can easily explore the rich features of AMANDA on - systems without tape drives. - - - cheap installations. - Without buying a tape drive you can enjoy the benefits - of AMANDA and backup to a bunch of harddisks. You can - create CD/DVD-sized backups which you can burn onto optical - disks later. - - - raid installations. - You can use the file-driver to backup onto a set of - file tapes hosted on a raid-system. Combined with - another AMANDA-configuration that dumps the file tapes to - real tapes, you can provide reliable backup with faster - tapeless recovery. - ---- - -SETUP - ---- - -BASICS - - This guide assumes you have setup the basic AMANDA-services - as described in the "INSTALL"-file. - - The configuration in this HOWTO is called "daily". - The file tapes are also called "vtapes" in this document, which - stands for "virtual tapes". - - Please be sure to understand the differences between holding disks and - file tapes. The two serve different purposes; holding disks allow for - parallelism of multiple DLE's being backed up while file tapes are a - replacement for physical tapes. - - Before beginning you will need to decide on (a) dedicated part(s) - of your hard disk(s) for your file tape storage. While this space - could be spread among several file systems and hard disks, I - recommend to dedicate at least a specific partition, better a specific - physical harddisk to the task of keeping your vtapes. - The use of a dedicated disk will speed things up definitely. - - The disk space you dedicate for your vtapes should NOT - be backed up by AMANDA. Also, for performance reasons there - should be NO holding disks on the same partition as the - vtapes, preferably not even on the same physical drive. - - If you only have one harddisk, it will work out, too, but - you will suffer low performance due to massive head-moving - in your harddisk, resulting from copying data between the - filesystems. - ---- - -STEPS - -Step 0. Prepare the filesystem(s) used for the tapes. - - Decide on where to put your files, create the - appropriate partition(s) and filesystem(s) and mount them. - - In our example we have the dedicated partition "hdc1", - mounted on /amandatapes for vtape storage. - - $ mount - ... - /dev/hdc1 on /amandatapes type reiserfs (rw) - ... - - Make sure there is space left. - Determine the amount of space you will use. - - $ df -h /amandatapes - Filesystem Size Used Avail Use% Mounted on - /dev/hdc1 20G 0G 20G 0% /amandatapes - - In our example we have 20GB diskspace left on /amandatapes. - -Step 1. Determine length and number of tapes - - After deciding on the number of vtapes you want to create, - evenly allocate the available space among them. - - Look at the following rule of thumb: - - As many types file systems exhibit dramatically reduced performance - when they are nearly full I have chosen to allocate - only 90% of the available space. So we have: - - (Available Space * 0.9) >= tapelength * tapecycle - - - This is a very conservative approach to make sure you don´t suffer - any performance drop due to a nearly-full-filesystem. - - As it is uncommon for AMANDA to fill, or almost fill an entire tape - you may also wish to use more space than that. - - So you could determine possible combinations of tapelength/tapecycle - with the more general formula: - - Available Space >= tapelength * tapecycle - - - In our example we take the conservative approach: - - 20 GB * 0.9 = 18 GB to use and so we could create the - following combinations: - - 18 GB = 18 GB * 1 - 18 GB = 9 GB * 2 - 18 GB = 6 GB * 3 - 18 GB = 3 GB * 6 - 18 GB = ......... you get the picture. - - Using only one tape is generally considered a bad idea - when it comes to backup, so we should use at least 3 - tapes (for testing purposes), better 6 or more tapes. - - 18 GB = 3 GB * 6 so we get the value 3GB for the - tapelength if we want to use 6 tapes. - -Step 2. Create a tapetype definition. - - Add a new tapetype definition similar to the following to your amanda.conf. - I named my definition "HARD-DISK". Choose whatever name you - consider appropriate. - - define tapetype HARD-DISK { - comment "Dump onto hard disk" - length 3072 mbytes # specified in mbytes to get the exact size of 3GB - } - - You don´t have to specify the "speed"-parameter (as it is - commonly listed in tapetype definitions and reported by - the program "amtapetype"). AMANDA does not use this parameter. - - There is also an optional "filemark"-parameter, which indicates - the amount of space wasted after each tape-section. Leave it - blank and AMANDA uses the default of 1KB. - -Step 3. Think about tapechangers. - - As you will use a set of vtapes, you have to also use a kind of vtape-changer. - There are several tape-changer-scripts included in the AMANDA-tarball. - Read more about tape-changer-scripts in TAPE.CHANGERS. - - Right now there are two scripts that can be used with vtapes. - These scripts take different approaches to the handling of tapes. - - The script chg-multi handles many drives with a tape in each drive. - The script chg-disk handles a library with one drive and multiple tapes. - - So with vtapes you could look at it this way: - - chg-multi simulates multiple tape drives with one tape in each drive. - chg-disk simulates one tape-library with multiple tapes in. - - As chg-multi exists for a much longer time than chg-disk, it is still - used in many AMANDA-vtape-installations. - - chg-disk was introduced with the snapshot 20031202. - Contrary to chg-multi, which is a generic changer-script that must - be somewhat adjusted to the use of the file-driver, chg-disk offers - exactly the behavior needed for handling vtapes - - IMHO the approach is much more logical, so I recommend to use chg-disk - in new AMANDA-vtape-installations. - - To use chg-disk you need to have at least amanda-2.4.4p1-20031202. - - Choose the one that fits your way of vtape-handling and -maintenance. - - In this HOWTO I only cover the use of chg-disk. - Usage of chg-multi is pretty similar and will maybe covered in a later - version of this document. - -Step 4. Set up your tape-config. - - In the general section you have to set the parameters tapecycle, - tapetype, tpchanger, changerfile, tapedev, rawtapedev and changerdev. - - Example: - - $ vi /usr/local/etc/amanda/daily/amanda.conf - ... - - tapecycle 6 - tapetype HARD-DISK - tpchanger "chg-disk" - changerfile "/usr/local/etc/amanda/daily/changer" - tapedev "file:/amandatapes/daily" - - This reflects the use of your defined tapetype. - - The "tapecycle"-parameter tells AMANDA how much tapes can be used. - Set this value according to the number of tapes you want to use. - - The "tapetype"-parameter points to the tapetype definition you have - created in Step 2. - - The "tpchanger"-parameter tells AMANDA to use the generic - tape-changer-script to handle the virtual tapes. You - can think of it as a virtual tape-changer-device. - - The "changerfile"-parameter is used to give chg-disk the "prefix" - for the "%s-changer, %s-clean, %s-slot" files it needs. - Use something like "changer" in your config-dir. - Please note that this file does NOT have to exist, but it won't - hurt anyway. - - The "tapedev"-parameter tells the chg-disk-script where the - root-dir for your vtapes is. - In our example the vtape-files go to - /amandatapes, and to separate multiple configurations we decided - to use subdirectories according to the configuration name "daily". - -Step 5. Create the virtual tapes. - - Now you have to create the tape-directories. - chg-disk needs a directory structure like: - - slot_root_dir -| - |- info - |- data -> slot1/ - |- slot1/ - |- slot2/ - |- ... - |- slotn/ - - where 'slot_root_dir' is the tapedev 'file:xxx' parameter - and 'n' is the tapecycle parameter. - - So in our example we do: - - $ mkdir /amandatapes/daily - - for the 'slot_root_dir' and - - $ mkdir /amandatapes/daily/slot1 - $ mkdir /amandatapes/daily/slot2 - .... - - for the virtual slots that will later contain the vtapes. - - If you have many vtapes to create and their names follow a pattern - you may be able to do them all with a single loop such as: - - $ for n in 1 2 3 4 5 6 7 8 9 10 11 12 - > do - > mkdir /amandatapes/daily/slot${n} - > done - - Create the info-file: - - $ touch /amandatapes/daily/info - - and link the first slot to the data-file (to "load" the vtape - in the first slot): - - $ ln -s /amandatapes/daily/slot1 /amandatapes/daily/data - - Make sure the AMANDA-user has write-permissions on these directories: - - $ chown -R /amandatapes - $ chgrp -R /amandatapes - $ chmod -R 750 /amandatapes - -Step 8. Label the virtual tapes. - - As the virtual tapes are handled just like physical - tapes by the AMANDA-Server they have to be labeled - before use. - - Usage: amlabel [-f]