]> git.sur5r.net Git - bacula/bacula/commitdiff
This commit was manufactured by cvs2svn to create tag Release-1.32b
author(no author) <(no author)@91ce42f0-d328-0410-95d8-f526ca767f89>
Wed, 15 Oct 2003 12:28:58 +0000 (12:28 +0000)
committer(no author) <(no author)@91ce42f0-d328-0410-95d8-f526ca767f89>
Wed, 15 Oct 2003 12:28:58 +0000 (12:28 +0000)
'Release-1.32b'.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/tags/Release-1.32b@748 91ce42f0-d328-0410-95d8-f526ca767f89

110 files changed:
bacula/ChangeLog
bacula/CheckList
bacula/Makefile.in
bacula/ReleaseNotes
bacula/autoconf/acconfig.h
bacula/autoconf/aclocal.m4
bacula/autoconf/config.h.in
bacula/autoconf/configure.in
bacula/configure
bacula/kernstodo
bacula/src/cats/mysql.c
bacula/src/dird/.cvsignore
bacula/src/dird/authenticate.c
bacula/src/dird/bsr.c
bacula/src/dird/catreq.c
bacula/src/dird/dird.c
bacula/src/dird/dird_conf.c
bacula/src/dird/getmsg.c
bacula/src/dird/next_vol.c
bacula/src/dird/protos.h
bacula/src/dird/sql_cmds.c
bacula/src/dird/ua_cmds.c
bacula/src/dird/ua_output.c
bacula/src/dird/ua_prune.c
bacula/src/dird/ua_restore.c
bacula/src/dird/ua_run.c
bacula/src/dird/ua_select.c
bacula/src/dird/ua_status.c
bacula/src/dird/verify.c
bacula/src/filed/.cvsignore
bacula/src/filed/job.c
bacula/src/filed/restore.c
bacula/src/findlib/attribs.c
bacula/src/findlib/bfile.c
bacula/src/findlib/create_file.c
bacula/src/gnome2-console/.cvsignore [deleted file]
bacula/src/jcr.h
bacula/src/lib/parse_conf.c
bacula/src/lib/util.c
bacula/src/stored/.cvsignore
bacula/src/stored/bcopy.c
bacula/src/stored/bextract.c
bacula/src/stored/block.c
bacula/src/stored/bscan.c
bacula/src/stored/btape.c
bacula/src/stored/dev.c
bacula/src/stored/fd_cmds.c
bacula/src/stored/job.c
bacula/src/stored/match_bsr.c
bacula/src/stored/mount.c
bacula/src/stored/parse_bsr.c
bacula/src/stored/protos.h
bacula/src/stored/read_record.c
bacula/src/stored/record.h
bacula/src/tools/testls.c
bacula/src/version.h
regress/.cvsignore [deleted file]
regress/README [deleted file]
regress/all-non-root-tape-tests [deleted file]
regress/all-non-root-tests [deleted file]
regress/all-root-tests [deleted file]
regress/all-tape-and-file-tests [deleted file]
regress/all-tests [deleted file]
regress/scripts/.cvsignore [deleted file]
regress/scripts/bacula-dir-tape.conf.in [deleted file]
regress/scripts/bacula-sd-tape.conf.in [deleted file]
regress/scripts/bacula-sd.conf.in [deleted file]
regress/scripts/cleanup [deleted file]
regress/scripts/cleanup-tape.in [deleted file]
regress/scripts/copy-confs [deleted file]
regress/scripts/copy-tape-confs [deleted file]
regress/scripts/copy-test-confs [deleted file]
regress/scripts/copy-testa-confs [deleted file]
regress/scripts/do_sed [deleted file]
regress/scripts/exclude-dev-test [deleted file]
regress/scripts/exclude-etc-test [deleted file]
regress/scripts/exclude-lib-test [deleted file]
regress/scripts/regress-config [deleted file]
regress/scripts/setup [deleted file]
regress/scripts/test-bacula-dir.conf.in [deleted file]
regress/scripts/test-bacula-fd.conf.in [deleted file]
regress/scripts/test-bacula-sd.conf.in [deleted file]
regress/scripts/test-console.conf.in [deleted file]
regress/scripts/testa-bacula-dir.conf.in [deleted file]
regress/tests/backup-bacula-tape [deleted file]
regress/tests/backup-bacula-test [deleted file]
regress/tests/bextract-test [deleted file]
regress/tests/bscan-test [deleted file]
regress/tests/bsr-opt-test [deleted file]
regress/tests/compressed-test [deleted file]
regress/tests/concurrent-jobs-test [deleted file]
regress/tests/dev-test-root [deleted file]
regress/tests/etc-test-root [deleted file]
regress/tests/four-concurrent-jobs-test [deleted file]
regress/tests/lib-test-root [deleted file]
regress/tests/recycle-test [deleted file]
regress/tests/restore-by-file-test [deleted file]
regress/tests/six-vol-test [deleted file]
regress/tests/small-file-size-tape [deleted file]
regress/tests/span-vol-test [deleted file]
regress/tests/sparse-compressed-test [deleted file]
regress/tests/sparse-test [deleted file]
regress/tests/test0 [deleted file]
regress/tests/two-jobs-test [deleted file]
regress/tests/two-vol-test [deleted file]
regress/tests/two-volume-tape [deleted file]
regress/tests/verify-vol-test [deleted file]
regress/tests/weird-files-test [deleted file]
regress/tests/weird-files2-test [deleted file]
regress/weird-files.tar.gz [deleted file]

index 69fbb609437d1c3a617f607ae7125a15f5eba529..c06d96429aa5278af715a05f92dbb479e60a8e41 100644 (file)
@@ -1,4 +1,73 @@
 
+2003-10-15 Version 1.32b 14Oct03 Release
+14Oct03
+- Modify configure so that if threaded MySQL client library
+  is not present, Bacula will link with the non-threaded 
+  version.
+- Updates to the Web pages and to the manual.
+- Remove trademark symbol from title. Phil pointed out that it
+  does not display correctly in a title.
+11Oct03
+- Implement restore by file before date. 
+- Change restore arguments a bit so that you can feed it
+  multiple jobid= specifications or multiple file= specifications.
+- Pass restore with run option on to run_cmd.
+- Make run-cmd not prompt if it has a "run" on the command line.
+10Oct03
+- When pruning, select only old orphanned jobs to delete so that
+  the current job is not pruned too.
+09Oct03
+- Corrected return status for bsf_dev and bsr_dev in block.c and btape.c
+- dev.c used incorrect ruturn status for bsf_dev in the BSF at EOM
+  code. This caused all appends on FreeBSD to fail.
+- Turn on fast block rejection code.
+08Oct03
+- Optimize file index searches by adding a count to the bootstrap.
+- Write single files/blocks to bootstrap without the second part.
+- Add current Volume status to the cannot use this Volume message.
+- Zero the rx->bsr in ua_restore when freeing so it doesn't get
+  freed twice.
+- Lots of testing on the restore
+- I noticed that SD and FD bootstrap files were not always
+  deleted, so delete them as soon as possible.
+- Restore by file (or by selecting files) created some
+  horrible looking bsr files that defeated the forward
+  spacing code, so fix write_findex to work right.
+- Add zlib_strerror() routine in filed/restore in case
+  of zlib errors.
+- In filed/restore.c make sure all error returns cleanup
+  and close the open file descriptor.
+- Make sure to set *non* over filename in attr packet
+  after file is found, so error messages that print the
+  filename don't print an old, incorrect name.
+- Allow bclose() to be called after closing the file.
+- Fix a number of unclear help messages, ... reported by
+  Phil in btape.
+- Retweak stored/read_record.c so that it does forward
+  spacing at the beginning of every tape, not just the
+  first one.
+- Print repositioning message if verbose is set.
+
+2003-10-01 Version 1.32a 03Oct03 Release
+04Oct03
+- Combine the code in ua_output and ua_status that searches
+  the run records.
+03Oct03
+- Fixed "list nextvol" to search for the correct pool in the
+  Schedule Run records.
+- Correct an error in is_block_zero. It found a false
+  match if the first 1016 bytes of a 32K buffer and     
+  the last 248 bytes are zero.  Broke the sparse option.
+01Oct03
+- More documentation.
+- Test if multiple mail addresses works. Yes.
+- Add debug Jmsg() to trigger if the file I/O packet is
+  not closed in the FD, i.e file descriptor leaks.
+- When error occurs reading label in mount.c, start from
+  the very top so that the retry count is in effect.
+- Zap the mode in soft links in testls.c for regression
+  testing.
+
 2003-10-01 Version 1.32 30Sep03 Release
 28Sep03
 - Enhance manual faq, regression ...
index ff26ed374ba20c6aadb3de2120a4ffdce661ef98..ccc71d7e7994056ee376ff530cd007242ff67cf3 100644 (file)
@@ -8,7 +8,7 @@
 - Update ChangeLog (add release date)
 - Do a cvs commit
 - Do a cvs -q export -D now -d bacula-1.nn bacula
-- Build new bacula-1.nn to ensure everything is committed
+- Run the regression tests on the new bacula
 - Write ReleaseNotes
 - If everything is good
 - cd bacula/k
index 87c3a4da94fc47aa79b09c57c467d624aa904dd6..65b008f80c610d44caf9587d89658527b7ca0a67 100755 (executable)
@@ -149,6 +149,7 @@ distclean:
        @$(RMF) -r doc/techlogs/2002/CVS doc/techlogs/2001/CVS doc/techlogs/1.27/CVS
        @$(RMF) -r examples/CVS intl/CVS scripts/CVS
        @$(RMF) -r po/CVS src/immortal/CVS rescue/freebsd/CVS rescue/solaris/CVS
+       @$(RMF) -r CVS src/gnome-console/CVS src/tconsole/CVS
 
 distdirs:
        mkdir ../$(VERNAME);
index 792bdc9e110ad008a5afe6e2eac9b41e47ad23d0..4831d591b5c6338fa12843cbfae7d2c2e98d7110 100644 (file)
@@ -1,9 +1,20 @@
 
-          Release Notes for Bacula 1.32
+          Release Notes for Bacula 1.32b
 
-  Bacula code: Total files = 259 Total lines = 77,740 (*.h *.c *.in)
+  Bacula code: Total files = 259 Total lines = 78,067 (*.h *.c *.in)
 
-Major Changes this Release:
+Most Significant Changes since 1.32a:
+- Improve forward space file/block during restore, many
+  optimizations.
+- Fix a bug that did not allow appending to a tape    
+  on FreeBSD systems.
+- Fix pruning so that it will not prune the current job.
+- Modify configure to use non-threaded MySQL client lib if
+  the threaded version is not present.
+- Implement restore by file before date.
+- When pruning don't prune the current job.
+
+Major Changes 1.32a Release:
 - Implemented forward space file/block whenever possible 
   during restore. Restoring a small number of files is now  
   much faster.
@@ -22,9 +33,14 @@ Major Changes this Release:
   be used is also added to the "status dir" output.
 - Lots of fixes with variable expansion and counter variables
 - Implemented a new Include/Exclude syntax.
+- While writing a tape, an end of file mark will be written
+  every 1Gb. This makes restores faster. If you want to
+  change this use "Maximum File Size" in the SD Device
+  resource.
 
 
-Other Changes this Release:
+Other Changes 1.32a Release:
+- Fixed sparse file bug.
 - A warning message is sent when a job starts that will be
   blocked because the user did an "unmount".
 - Block checksum errors if any are printed in the job report.
index a6fe066c74eee2c788cc0f4c3769333869a116f6..e9cef42055dd2798dbf4493faded6c55962d72db 100644 (file)
@@ -23,6 +23,9 @@
 /* Define if you want to use MySQL */
 #undef HAVE_MYSQL
 
+/* Defined if MySQL thread safe library is present */
+#undef HAVE_THREAD_SAFE_MYSQL
+
 /* Define if you want to use embedded MySQL */
 #undef HAVE_EMBEDDED_MYSQL
 
 #undef HAVE_OLD_SOCKOPT
  
 #undef HAVE_BIGENDIAN
-
index 8f0aab87b2002f13c8cdc3382119cfe188028045..1294fb138109bd7cd71ad58b8aab847a9b0e8ef1 100644 (file)
@@ -390,7 +390,12 @@ Which DBMS do you want to use (please select only one):
                 fi
         fi
     SQL_INCLUDE=-I$MYSQL_INCDIR
+    if test -f $MYSQL_LIBDIR/libmysqlclient_r.a; then
     SQL_LFLAGS="-L$MYSQL_LIBDIR -lmysqlclient_r -lz"
+       AC_DEFINE(HAVE_THREAD_SAFE_MYSQL)
+    else
+       SQL_LFLAGS="-L$MYSQL_LIBDIR -lmysqlclient -lz"
+    fi
     SQL_BINDIR=$MYSQL_BINDIR
 
     AC_DEFINE(HAVE_MYSQL)
index 13c47a86365786bc9887511b6ad3ab516d1d3af7..db3f80dc3cca8d4d9711d3f9f8f1fc039dfb36a5 100644 (file)
@@ -24,6 +24,9 @@
 /* Define if you want to use MySQL */
 #undef HAVE_MYSQL
 
+/* Defined if MySQL thread safe library is present */
+#undef HAVE_THREAD_SAFE_MYSQL
+
 /* Define if you want to use embedded MySQL */
 #undef HAVE_EMBEDDED_MYSQL
 
  
 #undef HAVE_BIGENDIAN
 
-
 /* Define to 1 if the `closedir' function returns void instead of `int'. */
 #undef CLOSEDIR_VOID
 
index f00fbe38a9d59b36d972d9590356a651bc52454c..92acf4feabe97107edc97ab4e4664ff2038df8e1 100644 (file)
@@ -505,7 +505,7 @@ AC_ARG_WITH(tcp-wrappers,
   [
     if test "x$withval" != "xno" ; then
        saved_LIBS="$LIBS"
-       LIBS="$LIBS -lwrap -lnsl"
+       LIBS="$saved_LIBS -lwrap"
        AC_MSG_CHECKING(for libwrap)
        AC_TRY_LINK(
          [ #include <tcpd.h>
@@ -517,8 +517,21 @@ AC_ARG_WITH(tcp-wrappers,
            AC_MSG_RESULT(yes)
            AC_DEFINE(HAVE_LIBWRAP)
            TCPW_MSG="yes" 
-         ],
-         [AC_MSG_ERROR([*** libwrap missing]) ]
+         ], [
+           LIBS="$saved_LIBS -lwrap -lnsl"
+           AC_TRY_LINK(
+             [ #include <tcpd.h>
+                int deny_severity = 0;
+                int allow_severity = 0;
+                struct request_info *req; ],
+             [ hosts_access(req); ],
+             [
+                AC_MSG_RESULT(yes)
+                AC_DEFINE(HAVE_LIBWRAP)
+                TCPW_MSG="yes" 
+             ],
+             [AC_MSG_ERROR([*** libwrap missing]) ] ]
+           )
        )
     fi
   ]
index 89b636774c14396cedcef9590c5faeb24029650b..6a93cc5f501711a5d101cdd5cfff17fb2d1f2f95 100755 (executable)
@@ -6326,7 +6326,7 @@ if test "${with_tcp_wrappers+set}" = set; then
 
     if test "x$withval" != "xno" ; then
        saved_LIBS="$LIBS"
-       LIBS="$LIBS -lwrap -lnsl"
+       LIBS="$saved_LIBS -lwrap"
        echo "$as_me:$LINENO: checking for libwrap" >&5
 echo $ECHO_N "checking for libwrap... $ECHO_C" >&6
        cat >conftest.$ac_ext <<_ACEOF
@@ -6369,6 +6369,52 @@ _ACEOF
 
            TCPW_MSG="yes"
 
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+           LIBS="$saved_LIBS -lwrap -lnsl"
+           cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+ #include <tcpd.h>
+                int deny_severity = 0;
+                int allow_severity = 0;
+                struct request_info *req;
+int
+main ()
+{
+ hosts_access(req);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (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
+
+                echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+                cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBWRAP 1
+_ACEOF
+
+                TCPW_MSG="yes"
+
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
@@ -6377,6 +6423,9 @@ sed 's/^/| /' conftest.$ac_ext >&5
 echo "$as_me: error: *** libwrap missing" >&2;}
    { (exit 1); exit 1; }; }
 
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
     fi
@@ -6685,7 +6734,15 @@ echo "$as_me: error: Invalid MySQL directory $withval - unable to find mysql.h u
                 fi
         fi
     SQL_INCLUDE=-I$MYSQL_INCDIR
+    if test -f $MYSQL_LIBDIR/libmysqlclient_r.a; then
     SQL_LFLAGS="-L$MYSQL_LIBDIR -lmysqlclient_r -lz"
+       cat >>confdefs.h <<\_ACEOF
+#define HAVE_THREAD_SAFE_MYSQL 1
+_ACEOF
+
+    else
+       SQL_LFLAGS="-L$MYSQL_LIBDIR -lmysqlclient -lz"
+    fi
     SQL_BINDIR=$MYSQL_BINDIR
 
     cat >>confdefs.h <<\_ACEOF
index 2fd0b1e69720b88e53f5609b575438e0f55b7ef3..14e8c54c4929c222d5d5091e8fdf2f2047357fe8 100644 (file)
@@ -21,18 +21,100 @@ Testing to do: (painful)
 - Test cancel at EOM.       
 - Test not zeroing Autochanger slot when it is wrong.
 - Figure out how to use ssh or stunnel to protect Bacula communications.
-- Test connect timeouts.
 
-For 1.32 Testing/Documentation:
+For 1.33 Testing/Documentation:
+- bextract is sending everything to the log file ****FIXME****
+- Document to start higher priorty jobs before lower ones.
+- suppress "Do not forget to mount the drive!!!" if error
 - Document new records in Director. SDAddress SDDeviceName, SDPassword.
   FDPassword, FDAddress, DBAddress, DBPort, DBPassword.
 - Document new Include/Exclude ...
 - Add test of exclusion, test multiple Include {} statements.
 - Add counter variable test.
+- Document ln -sf /usr/lib/libncurses.so /usr/lib/libtermcap.so
+  and install the esound-dev  package for compiling Console on 
+  SuSE.
                 
-For 1.32:
-
 For 1.33
+- Try doing a raw partition backup and restore by mounting a
+  Windows partition.
+- Implement Verify=DiskToCatalog
+- Implement a RunAfterFailedJob
+- Report CVS problems to SourceForge.
+- Implement .consolerc for Console
+- Is it really important to make Job name the same to find the
+  Full backup to avoid promoting an Incremental job?
+- Start label, then run job when tape labeled, it should broadcast.
+- Zap illegal characters in job name for mail files (e.g. /).
+- From Lars Köllers:
+    Yes, it would allow to highly automatic the request for new tapes. If a 
+    tape is empty, bacula reads the barcodes (native or simulated), and if 
+    an unused tape is found, it runs the label command with all the 
+    necessary parameters.
+
+    By the way can bacula automatically "move" an empry/purged volume say 
+    in the "short" pool to the "long" pool if this pool runs out of volume 
+    space?
+- Implement a move Volume from one pool to another.
+- Either restrict the characters in a name, or fix the problem 
+  emailing with names containing / (smtp command line breaks).
+- Eliminate ua_retention.c (retentioncmd) if possible.
+- Eliminate orphaned jobs: dbcheck, normal pruning, delete job command.
+  Hm.  Well, there are the remaining orphaned job records:
+
+     |   105 | Llioness Save  | 0000-00-00 00:00:00 | B    | D     |        0 |             0 | f         |
+     |   110 | Llioness Save  | 0000-00-00 00:00:00 | B    | I     |        0 |             0 | f         |
+     |   115 | Llioness Save  | 2003-09-10 02:22:03 | B    | I     |        0 |             0 | A         |
+     |   128 | Catalog Save   | 2003-09-11 03:53:32 | B    | I     |        0 |             0 | C         |
+     |   131 | Catalog Save   | 0000-00-00 00:00:00 | B    | I     |        0 |             0 | f         |
+
+     As you can see, three of the five are failures.  I already deleted the
+     one restore and one other failure using the by-client option.  Deciding
+     what is an orphaned job is a tricky problem though, I agree.  All these
+     records have or had 0 files/ 0 bytes, except for the restore.  With no
+     files, of course, I don't know of the job ever actually becomes
+     associated with a Volume.
+
+     (I'm not sure if this is documented anywhere -- what are the meanings of
+     all the possible JobStatus codes?)
+
+     Looking at my database, it appears to me as though all the "orphaned"
+     jobs fit into one of two categories:
+
+     1)  The Job record has a StartTime but no EndTime, and the job is not
+     Â Â Â  currently running;
+     or
+     2)  The Job record has an EndTime, indicating that it completed, but
+     Â Â Â  it has no associated JobMedia record.
+
+
+     This does suggest an approach.  If failed jobs (or jobs that, for some
+     other reason, write no files) are associated with a volume via a
+     JobMedia record, then they should be purged when the associated volume
+     is purged.  I see two ways to handle jobs that are NOT associated with a
+     specific volume:
+
+     1)  purge them automatically whenever any volume is manually purged;
+     or
+     2)  add an option to the purge command to manually purge all jobs with
+     Â Â Â  no associated volume.
+
+     I think Restore jobs also fall into category 2 above ....  so one might
+     want to make that "The Job record has an EndTime,, but no associated
+     JobMedia record, and is not a Restore job."  
+- Implement RestoreJobRetention? Maybe better "JobRetention" in a Job,
+  which would take precidence over the Catalog "JobRetention".
+- Implement Label Format in Add and Label console commands.
+- make "btape /tmp" work.
+- Make sure a rescheduled job is properly reported by status.
+- Walk through the Pool records rather than the Job records
+  in dird.c to create/update pools.
+- Figure out a way to move Volumes from one pool to another.
+- What to do about "list files job=xxx".
+- Implement delete Job.
+- Document need to put LabelFormat in quotes.
+- Implement scan: for every slot it finds, zero the slot of
+  Volume other volume having that slot.
 - When job rescheduled, status gives is waiting for Client Rufus 
   to connect to Storage File. Dir needs to inform SD that job
   is rescheduled.
@@ -61,7 +143,7 @@ For 1.33
 - Use system dependent calls to get more precise info on tape errors.
 - Add heartbeat from FD to SD if hb interval expires.
 - Suppress read error on blank tape when doing a label.
-- Can we dynamically change FileSets.
+- Can we dynamically change FileSets?
 - If pool specified to label command and Label Format is specified,
   automatically generate the Volume name.
 - Take a careful look a the Basic recycling algorithm.  When Bacula
@@ -121,7 +203,8 @@ For 1.33
   > > prod4-sd: End of medium on Volume "REU007" Bytes=16,303,521,933 
 
 - Use autochanger to handle multiple devices.
-- Fix packet too big problem.
+- Fix packet too big problem. This is most likely a Windows TCP stack 
+  problem.
 - Add SuSE install doc to list.
 - Check and rechedk "Invalid block number"
 - Make bextract release the drive properly between tapes 
@@ -958,4 +1041,9 @@ Done: (see kernsdone for more)
 - Document that it is safe to use the drive when the lights stop flashing.
 - Document all the status codes JobLevel, JobType, JobStatus.
 - Add GUI interface to manual
-
+- Combine the 3 places that search run records for the next
+  job. Use find_job_pool() modified in ua_output.c
+- Test connect timeouts.
+- Fix FreeBSD build with tcp_wrapper -- should not have -lnsl
+- Implement fast block rejection.
+- I want to restore by file to some date.
index 3b474819b01bbaa64d42cea38fb1b209c09855d1..719aab5cd8db50da25287b4ff8fc3d15c673d2ac 100644 (file)
@@ -176,7 +176,9 @@ It is probably not running or your password is incorrect.\n"),
       return 0;
    }
 
+#ifdef HAVE_TREAD_SAFE_MYSQL
    my_thread_init();
+#endif
 
    mdb->connected = TRUE;
    V(mutex);
@@ -188,7 +190,9 @@ db_close_database(JCR *jcr, B_DB *mdb)
 {
    P(mutex);
    mdb->ref_count--;
+#ifdef HAVE_TREAD_SAFE_MYSQL
    my_thread_end();
+#endif
    if (mdb->ref_count == 0) {
       qdchain(&mdb->bq);
       if (mdb->connected && mdb->db) {
index e5ca4c1c7b0e2f094be3cfd07cea5c6af5529867..fb6ff2128cf971094257e8a212b97e40f6c2de6a 100644 (file)
@@ -8,3 +8,4 @@ btraceback
 btraceback.gdb
 startit
 stopit
+dird.conf
index b41ca667c683600eb13a84e54c28d5675eece5be..9ec6d81bf1b3e12a2ac4b6af2cd6f91335bddcb9 100644 (file)
@@ -69,7 +69,7 @@ int authenticate_storage_daemon(JCR *jcr)
    }
    if (!cram_md5_get_auth(sd, jcr->store->password, ssl_need) || 
        !cram_md5_auth(sd, jcr->store->password, ssl_need)) {
-      Jmsg0(jcr, M_FATAL, 0, _("Director and Storage daemon passwords not the same.\n"));
+      Jmsg0(jcr, M_FATAL, 0, _("Director and Storage daemon passwords or names not the same.\n"));
       return 0;
    }
    Dmsg1(116, ">stored: %s", sd->msg);
@@ -106,7 +106,7 @@ int authenticate_file_daemon(JCR *jcr)
    }
    if (!cram_md5_get_auth(fd, jcr->client->password, ssl_need) || 
        !cram_md5_auth(fd, jcr->client->password, ssl_need)) {
-      Jmsg(jcr, M_FATAL, 0, _("Director and File daemon passwords not the same.\n"));
+      Jmsg(jcr, M_FATAL, 0, _("Director and File daemon passwords or names not the same.\n"));
       return 0;
    }
    Dmsg1(116, ">filed: %s", fd->msg);
index ae8ddf2a7e27830a24c0b2ff5983bd6fbba6aae8..b2db2e321bfc0f8331e516e22a7d286f3a77267d 100644 (file)
@@ -35,6 +35,7 @@
 
 /* Forward referenced functions */
 static void write_bsr(UAContext *ua, RBSR *bsr, FILE *fd);
+void print_bsr(UAContext *ua, RBSR *bsr);
 
 
 /*
@@ -62,21 +63,31 @@ static void free_findex(RBSR_FINDEX *fi)
  *  range regardless of volume. The FirstIndex and LastIndex
  *  passed in here are for the current volume, so when 
  *  writing out the fi, constrain them to those values.
+ *
+ * We are called here once for each JobMedia record
+ *  for each Volume.
  */
-static void write_findex(UAContext *ua, RBSR_FINDEX *fi, 
+static uint32_t write_findex(UAContext *ua, RBSR_FINDEX *fi, 
              int32_t FirstIndex, int32_t LastIndex, FILE *fd) 
 {
-   if (fi) {
+   uint32_t count = 0;
+   for ( ; fi; fi=fi->next) {
       int32_t findex, findex2;
+      if ((fi->findex >= FirstIndex && fi->findex <= LastIndex) ||
+         (fi->findex2 >= FirstIndex && fi->findex2 <= LastIndex) ||
+         (fi->findex < FirstIndex && fi->findex2 > LastIndex)) {
       findex = fi->findex < FirstIndex ? FirstIndex : fi->findex;
       findex2 = fi->findex2 > LastIndex ? LastIndex : fi->findex2;
       if (findex == findex2) {
          fprintf(fd, "FileIndex=%d\n", findex);
+           count++;
       } else {
          fprintf(fd, "FileIndex=%d-%d\n", findex, findex2);
+           count += findex2 - findex + 1;
+      }
       }
-      write_findex(ua, fi->next, FirstIndex, LastIndex, fd);
    }
+   return count;
 }
 
 /*
@@ -101,13 +112,15 @@ static bool is_volume_selected(RBSR_FINDEX *fi,
 
 static void print_findex(UAContext *ua, RBSR_FINDEX *fi)
 {
-   if (fi) {
+   bsendmsg(ua, "fi=0x%x\n", (unsigned)fi);
+   for ( ; fi; fi=fi->next) {
       if (fi->findex == fi->findex2) {
          bsendmsg(ua, "FileIndex=%d\n", fi->findex);
+//       Dmsg1(000, "FileIndex=%d\n", fi->findex);
       } else {
          bsendmsg(ua, "FileIndex=%d-%d\n", fi->findex, fi->findex2);
+//       Dmsg2(000, "FileIndex=%d-%d\n", fi->findex, fi->findex2);
       }
-      print_findex(ua, fi->next);
    }
 }
 
@@ -124,10 +137,10 @@ void free_bsr(RBSR *bsr)
 {
    if (bsr) {
       free_findex(bsr->fi);
-      free_bsr(bsr->next);
       if (bsr->VolParams) {
         free(bsr->VolParams);
       }
+      free_bsr(bsr->next);
       free(bsr);
    }
 }
@@ -210,6 +223,11 @@ int write_bsr_file(UAContext *ua, RBSR *bsr)
 static void write_bsr(UAContext *ua, RBSR *bsr, FILE *fd)
 {
    if (bsr) {
+      uint32_t count;
+      /*
+       * For a given volume, loop over all the JobMedia records.
+       *   VolCount is the number of JobMedia records.
+       */
       for (int i=0; i < bsr->VolCount; i++) {
         if (!is_volume_selected(bsr->fi, bsr->VolParams[i].FirstIndex,
              bsr->VolParams[i].LastIndex)) {
@@ -219,21 +237,32 @@ static void write_bsr(UAContext *ua, RBSR *bsr, FILE *fd)
          fprintf(fd, "Volume=\"%s\"\n", bsr->VolParams[i].VolumeName);
          fprintf(fd, "VolSessionId=%u\n", bsr->VolSessionId);
          fprintf(fd, "VolSessionTime=%u\n", bsr->VolSessionTime);
+        if (bsr->VolParams[i].StartFile == bsr->VolParams[i].EndFile) {
+            fprintf(fd, "VolFile=%u\n", bsr->VolParams[i].StartFile);
+        } else {
          fprintf(fd, "VolFile=%u-%u\n", bsr->VolParams[i].StartFile, 
                 bsr->VolParams[i].EndFile);
+        }
+        if (bsr->VolParams[i].StartBlock == bsr->VolParams[i].EndBlock) {
+            fprintf(fd, "VolFile=%u\n", bsr->VolParams[i].StartBlock);
+        } else {
          fprintf(fd, "VolBlock=%u-%u\n", bsr->VolParams[i].StartBlock,
                 bsr->VolParams[i].EndBlock);
-
+        }
 //       Dmsg2(000, "bsr VolParam FI=%u LI=%u\n",
 //         bsr->VolParams[i].FirstIndex, bsr->VolParams[i].LastIndex);
-        write_findex(ua, bsr->fi, bsr->VolParams[i].FirstIndex,
+
+        count = write_findex(ua, bsr->fi, bsr->VolParams[i].FirstIndex,
            bsr->VolParams[i].LastIndex, fd);
+        if (count) {
+            fprintf(fd, "Count=%u\n", count);
+        }
       }
       write_bsr(ua, bsr->next, fd);
    }
 }
 
-static void print_bsr(UAContext *ua, RBSR *bsr)
+void print_bsr(UAContext *ua, RBSR *bsr)
 {
    if (bsr) {
       for (int i=0; i < bsr->VolCount; i++) {
@@ -296,7 +325,7 @@ void add_findex(RBSR *bsr, uint32_t JobId, int32_t findex)
    }
 
    /* 
-    * At this point, bsr points to bsr containing JobId,
+    * At this point, bsr points to bsr containing this JobId,
     *  and we are sure that there is at least one fi record.
     */
    lfi = fi = bsr->fi;
@@ -318,6 +347,10 @@ void add_findex(RBSR *bsr, uint32_t JobId, int32_t findex)
       if (findex == (fi->findex2 + 1)) {  /* extend up */
         RBSR_FINDEX *nfi;     
         fi->findex2 = findex;
+        /*
+         * If the following record contains one higher, merge its
+         *   file index by extending it up.
+         */
         if (fi->next && ((findex+1) == fi->next->findex)) { 
            nfi = fi->next;
            fi->findex2 = nfi->findex2;
index 05f7f1e8841f92caae7fc5c5e52a25a9423f3940..457cc402b1897accdfd78a351b45488f53e6dce3 100644 (file)
@@ -164,7 +164,8 @@ void catalog_request(JCR *jcr, BSOCK *bs, char *msg)
             Dmsg2(100, "Vol Info for %s: %s", jcr->Job, bs->msg);
         } else { 
            /* Not suitable volume */
-            bnet_fsend(bs, "1998 Volume \"%s\" %s.\n", mr.VolumeName, reason);
+            bnet_fsend(bs, "1998 Volume \"%s\" status is %s, %s.\n", mr.VolumeName, 
+              mr.VolStatus, reason);
         }
 
       } else {
index eb0a4758ecf612b5e77c7990d39522f240010132..410cbb5d36c06e941f3cbb674f4561b702925533 100644 (file)
@@ -241,7 +241,7 @@ static void terminate_dird(int sig)
    delete_pid_file(director->pid_directory, "bacula-dir",  
                   director->DIRport);
    stop_watchdog();
-   signal(SIGCHLD, SIG_IGN);          /* don't worry about children now */
+// signal(SIGCHLD, SIG_IGN);          /* don't worry about children now */
    term_scheduler();
    if (runjob) {
       free(runjob);
index 47c9f98581eafa706c18c68aeb837bfea747fa4c..20f8ae7eecd8464249fa927db6d0bb879bb5c4b8 100644 (file)
@@ -345,6 +345,7 @@ struct s_jl joblevels[] = {
    {"Catalog",       L_VERIFY_CATALOG,  JT_VERIFY},
    {"InitCatalog",   L_VERIFY_INIT,     JT_VERIFY},
    {"VolumeToCatalog", L_VERIFY_VOLUME_TO_CATALOG,   JT_VERIFY},
+   {"DiskToCatalog", L_VERIFY_DISK_TO_CATALOG,   JT_VERIFY},
    {"Data",          L_VERIFY_DATA,     JT_VERIFY},
    {NULL,           0}
 };
index b2309f37091e4b5e511430ad9bf2390b83fcf78c..34193975c0cf853c25d3a9ab98d5ed6df2e5c2d8 100644 (file)
@@ -95,7 +95,8 @@ int bget_dirmsg(BSOCK *bs)
            bnet_fsend(bs, OK_msg); /* send response */
            break;
         case BNET_HEARTBEAT:
-       /*   Dmsg0(000, "Got heartbeat.\n"); */
+//         encode_time(time(NULL), Job);
+//          Dmsg1(000, "%s got heartbeat.\n", Job);
            break;
         case BNET_HB_RESPONSE:
            break;
index 043fd1ac93ad646d07b9e53c5630432b3853a7bf..ddb4e125b7e9f480ba9682bf1b6c0b55d84e1e80 100644 (file)
@@ -207,13 +207,13 @@ bool is_volume_valid_or_recyclable(JCR *jcr, MEDIA_DBR *mr, char **reason)
         return true;
       } else {
          /* In principle this shouldn't happen */
-         *reason = "recycling of current volume failed";
+         *reason = "and recycling of current volume failed";
         return false;
       }
    }
                                                                                        
    /* At this point, the volume is not valid for writing */
-   *reason = "not Append, Purged or Recycle";
+   *reason = "but should be Append, Purged or Recycle";
                                                                                        
    /*
     * What we're trying to do here is see if the current volume is
@@ -241,11 +241,11 @@ bool is_volume_valid_or_recyclable(JCR *jcr, MEDIA_DBR *mr, char **reason)
             Jmsg(jcr, M_INFO, 0, "Recycled current volume \"%s\"\n", mr->VolumeName);
            return true;               /* Good volume */
         } else {
-            *reason = "not Append, Purged or Recycle (recycling of the "
+            *reason = "but should be Append, Purged or Recycle (recycling of the "
                "current volume failed)";
         }
       } else {
-         *reason = "not Append, Purged or Recycle (cannot automatically "
+         *reason = "but should be Append, Purged or Recycle (cannot automatically "
             "recycle current volume, as it still contains unpruned data)";
       }
    }
index a4b48609dec3bebc46cb4fb83b121f3f49063c0a..0d77157ddc933027df37491637dd23a4bf0ae600 100644 (file)
@@ -132,6 +132,7 @@ int is_volume_name_legal(UAContext *ua, char *name);
 /* ua_output.c */
 void prtit(void *ctx, char *msg);
 int complete_jcr_for_job(JCR *jcr, JOB *job, POOL *pool);
+RUN *find_next_run(JOB *job, time_t &runtime);
 
 /* ua_server.c */
 void bsendmsg(void *sock, char *fmt, ...);
index ce8e774cc78db61e430eb8e2348227363b1d7475..2ad029bb35ba6b4c9ed071d73ca8615fe65b8422 100644 (file)
@@ -85,12 +85,14 @@ char *insert_delcand =
 /* Select Jobs from the DelCandidates table that have a
  * more recent backup -- i.e. are not the only backup.
  * This is the list of Jobs to delete for a Backup Job.
+ * At the same time, we select "orphanned" jobs
+ * (i.e. no files, ...) for deletion.
  */
 char *select_backup_del =
    "SELECT DelCandidates.JobId "
    "FROM Job,DelCandidates "
-   "WHERE (DelCandidates.JobFiles=0) OR "
-   "(DelCandidates.JobStatus!='T') OR "
+   "WHERE (JobTDate<%s AND ((DelCandidates.JobFiles=0) OR "
+   "(DelCandidates.JobStatus!='T'))) OR "
    "(Job.JobTDate>%s "
    "AND Job.ClientId=%u "
    "AND Job.Type='B' "
@@ -211,7 +213,7 @@ char *uar_inc_dec =
    "Job.Level,Job.JobFiles,Job.StartTime,Media.VolumeName,JobMedia.StartFile,"
    "Job.VolSessionId,Job.VolSessionTime "
    "FROM Job,JobMedia,Media "
-   "WHERE Job.JobTDate>%s AND Job.StartTime < '%s' "
+   "WHERE Job.JobTDate>%s AND Job.StartTime<'%s' "
    "AND Job.ClientId=%u "
    "AND JobMedia.JobId=Job.JobId "
    "AND JobMedia.MediaId=Media.MediaId "
@@ -239,10 +241,11 @@ char *uar_mediatype =
    "SELECT MediaType FROM JobMedia,Media WHERE JobMedia.JobId=%u "
    "AND JobMedia.MediaId=Media.MediaId";
 
-/* Find JobId, FileIndex for a given path/file */
+/* Find JobId, FileIndex for a given path/file and date */
 char *uar_jobid_fileindex = 
    "SELECT Job.JobId, File.FileIndex FROM Job,File,Path,Filename,Client "
    "WHERE Job.JobId=File.JobId "
+   "AND Job.StartTime<'%s' "
    "AND Path.Path='%s' "
    "AND Filename.Name='%s' "
    "AND Client.Name='%s' "
index 7acb0d12161b10f20675e2c27c4143f3a2317004..c455d086b4c2069b68ab4a33b8b7d3b55ecb6226 100644 (file)
@@ -50,11 +50,11 @@ extern int messagescmd(UAContext *ua, char *cmd);
 extern int autodisplaycmd(UAContext *ua, char *cmd);
 extern int sqlquerycmd(UAContext *ua, char *cmd);
 extern int querycmd(UAContext *ua, char *cmd);
-extern int runcmd(UAContext *ua, char *cmd);
+extern int run_cmd(UAContext *ua, char *cmd);
 extern int retentioncmd(UAContext *ua, char *cmd);
 extern int prunecmd(UAContext *ua, char *cmd);
 extern int purgecmd(UAContext *ua, char *cmd);
-extern int restorecmd(UAContext *ua, char *cmd);
+extern int restore_cmd(UAContext *ua, char *cmd);
 extern int label_cmd(UAContext *ua, char *cmd);
 extern int relabel_cmd(UAContext *ua, char *cmd);
 extern int update_slots(UAContext *ua);  /* ua_label.c */
@@ -105,8 +105,8 @@ static struct cmdstruct commands[] = {
  { N_("quit"),       quit_cmd,      _("quit")},
  { N_("relabel"),    relabel_cmd,   _("relabel a tape")},
  { N_("release"),    release_cmd,   _("release <storage-name>")},
- { N_("restore"),    restorecmd,    _("restore files")},
- { N_("run"),        runcmd,        _("run <job-name>")},
+ { N_("restore"),    restore_cmd,   _("restore files")},
+ { N_("run"),        run_cmd,       _("run <job-name>")},
  { N_("setdebug"),   setdebug_cmd,  _("sets debug level")},
  { N_("show"),       show_cmd,      _("show (resource records) [jobs | pools | ... | all]")},
  { N_("sqlquery"),   sqlquerycmd,   _("use SQL to query catalog")}, 
index b79001982e9d941adf14c83b8e4156f3263521f0..35f019567e9749f0483119317cc25e837afcff92 100644 (file)
@@ -372,6 +372,10 @@ static int do_list_cmd(UAContext *ua, char *cmd, e_list_type llist)
                  strcasecmp(ua->argk[i], _("nextvolume")) == 0) {
         JOB *job;
         JCR *jcr = ua->jcr;
+        POOL *pool;
+        RUN *run;
+        time_t runtime;
+
          i = find_arg_with_value(ua, "job");
         if (i <= 0) {
            if ((job = select_job_resource(ua)) == NULL) {
@@ -386,7 +390,9 @@ static int do_list_cmd(UAContext *ua, char *cmd, e_list_type llist)
               }
            }
         }
-        if (!complete_jcr_for_job(jcr, job, NULL)) {
+        run = find_next_run(job, runtime);
+        pool = run ? run->pool : NULL;
+        if (!complete_jcr_for_job(jcr, job, pool)) {
            return 1;
         }
           
@@ -408,6 +414,92 @@ static int do_list_cmd(UAContext *ua, char *cmd, e_list_type llist)
    return 1;
 }
 
+/* 
+ * For a given job, we examine all his run records
+ *  to see if it is scheduled today or tomorrow.
+ */
+RUN *find_next_run(JOB *job, time_t &runtime)
+{
+   time_t now, tomorrow;
+   RUN *run;
+   SCHED *sched;
+   struct tm tm;
+   int mday, wday, month, wpos, tmday, twday, tmonth, twpos, i, hour;
+   int tod, tom;
+
+   Dmsg0(200, "enter find_runs()\n");
+
+   sched = job->schedule;
+   if (sched == NULL) {           /* scheduled? */
+      return NULL;                /* no nothing to report */
+   }
+   /* Break down current time into components */ 
+   now = time(NULL);
+   localtime_r(&now, &tm);
+   mday = tm.tm_mday - 1;
+   wday = tm.tm_wday;
+   month = tm.tm_mon;
+   wpos = (tm.tm_mday - 1) / 7;
+
+   /* Break down tomorrow into components */
+   tomorrow = now + 60 * 60 * 24;
+   localtime_r(&tomorrow, &tm);
+   tmday = tm.tm_mday - 1;
+   twday = tm.tm_wday;
+   tmonth = tm.tm_mon;
+   twpos  = (tm.tm_mday - 1) / 7;
+
+   for (run=sched->run; run; run=run->next) {
+      /* 
+       * Find runs in next 24 hours
+       */
+      tod = (bit_is_set(mday, run->mday) || bit_is_set(wday, run->wday)) && 
+            bit_is_set(month, run->month) && bit_is_set(wpos, run->wpos);
+
+      tom = (bit_is_set(tmday, run->mday) || bit_is_set(twday, run->wday)) &&
+            bit_is_set(tmonth, run->month) && bit_is_set(wpos, run->wpos);
+
+      Dmsg2(200, "tod=%d tom=%d\n", tod, tom);
+      if (tod) {                  /* Jobs scheduled today (next 24 hours) */
+        /* find time (time_t) job is to be run */
+        localtime_r(&now, &tm);
+        hour = 0;
+        for (i=tm.tm_hour; i < 24; i++) {
+           if (bit_is_set(i, run->hour)) {
+              tm.tm_hour = i;
+              tm.tm_min = run->minute;
+              tm.tm_sec = 0;
+              runtime = mktime(&tm);
+              if (runtime > now) {
+                 return run;         /* found it, return run resource */
+              }
+           }
+        }
+      }
+
+//    Dmsg2(200, "runtime=%d now=%d\n", runtime, now);
+      if (tom) {               /* look at jobs scheduled tomorrow */
+        localtime_r(&tomorrow, &tm);
+        hour = 0;
+        for (i=0; i < 24; i++) {
+           if (bit_is_set(i, run->hour)) {
+              hour = i;
+              break;
+           }
+        }
+        tm.tm_hour = hour;
+        tm.tm_min = run->minute;
+        tm.tm_sec = 0;
+        runtime = mktime(&tm);
+         Dmsg2(200, "truntime=%d now=%d\n", runtime, now);
+        if (runtime < tomorrow) {
+           return run;               /* found it, return run resource */
+        }
+      }
+   } /* end for loop over runs */ 
+   /* Nothing found */
+   return NULL;
+}
 /* 
  * Fill in the remaining fields of the jcr as if it
  *  is going to run the job.
index cd6684a3f1e4a546f73500ded3a325ad17b382f3..2278405d8007e1169ba40b7bb68b577e3a7674a1 100644 (file)
@@ -270,7 +270,7 @@ int prune_files(UAContext *ua, CLIENT *client)
 
    del.JobId = (JobId_t *)malloc(sizeof(JobId_t) * del.max_ids);
 
-   /* Now process same set but making delete list */
+   /* Now process same set but making delete list */
    db_sql_query(ua->db, query, file_delete_handler, (void *)&del);
 
    for (i=0; i < del.num_ids; i++) {
@@ -286,7 +286,7 @@ int prune_files(UAContext *ua, CLIENT *client)
        * Now mark Job as having files purged. This is necessary to
        * avoid having too many Jobs to process in future prunings. If
        * we don't do this, the number of JobId's in our in memory list
-       * will grow very large.
+       * could grow very large.
        */
       Mmsg(&query, upd_Purged, del.JobId[i]);
       db_sql_query(ua->db, query, NULL, (void *)NULL);
@@ -415,7 +415,7 @@ int prune_jobs(UAContext *ua, CLIENT *client, int JobType)
    switch (JobType) {
    case JT_ADMIN:
    case JT_BACKUP:
-      Mmsg(&query, select_backup_del, ed1, cr.ClientId);
+      Mmsg(&query, select_backup_del, ed1, ed1, cr.ClientId);
       break;
    case JT_RESTORE:
       Mmsg(&query, select_restore_del, ed1, cr.ClientId);
index c195a50ef4a1199de5931e609fc618f37f274861..721ad494d8f79f793c8fc9491943b0a263350950 100644 (file)
@@ -38,7 +38,8 @@
 
 
 /* Imported functions */
-extern int runcmd(UAContext *ua, char *cmd);
+extern int run_cmd(UAContext *ua, char *cmd);
+extern void print_bsr(UAContext *ua, RBSR *bsr);
 
 /* Imported variables */
 extern char *uar_list_jobs,    *uar_file,        *uar_sel_files;
@@ -100,15 +101,17 @@ static void build_directory_tree(UAContext *ua, RESTORE_CTX *rx);
 static void free_rx(RESTORE_CTX *rx);
 static void split_path_and_filename(RESTORE_CTX *rx, char *fname);
 static int jobid_fileindex_handler(void *ctx, int num_fields, char **row);
-static int insert_file_into_findex_list(UAContext *ua, RESTORE_CTX *rx, char *file);
-static void insert_one_file(UAContext *ua, RESTORE_CTX *rx);
+static int insert_file_into_findex_list(UAContext *ua, RESTORE_CTX *rx, char *file,
+                                       char *date);
+static void insert_one_file(UAContext *ua, RESTORE_CTX *rx, char *date);
 static int get_client_name(UAContext *ua, RESTORE_CTX *rx);
+static int get_date(UAContext *ua, char *date, int date_len);
 
 /*
  *   Restore files
  *
  */
-int restorecmd(UAContext *ua, char *cmd)
+int restore_cmd(UAContext *ua, char *cmd)
 {
    RESTORE_CTX rx;                   /* restore context */
    JOB *job = NULL;
@@ -164,7 +167,7 @@ int restorecmd(UAContext *ua, char *cmd)
    case 1:                           /* select by jobid */
       build_directory_tree(ua, &rx);
       break;
-   case 2:
+   case 2:                           /* select by filename, no tree needed */
       break;
    }
 
@@ -174,7 +177,6 @@ int restorecmd(UAContext *ua, char *cmd)
         free_rx(&rx);
         return 0;
       }
-//    print_bsr(ua, rx.bsr);
       write_bsr_file(ua, rx.bsr);
       bsendmsg(ua, _("\n%u file%s selected to restore.\n\n"), rx.selected_files,
          rx.selected_files==1?"":"s");
@@ -210,10 +212,12 @@ int restorecmd(UAContext *ua, char *cmd)
           job->hdr.name, rx.ClientName, rx.store?rx.store->hdr.name:"",
          working_directory);
    }
-   
+   if (find_arg(ua, _("run")) >= 0) {
+      pm_strcat(&ua->cmd, " run");    /* pass it on to the run command */
+   }
    Dmsg1(400, "Submitting: %s\n", ua->cmd);
    parse_ua_args(ua);
-   runcmd(ua, ua->cmd);
+   run_cmd(ua, ua->cmd);
 
    bsendmsg(ua, _("Restore command done.\n"));
    free_rx(&rx);
@@ -223,6 +227,7 @@ int restorecmd(UAContext *ua, char *cmd)
 static void free_rx(RESTORE_CTX *rx) 
 {
    free_bsr(rx->bsr);
+   rx->bsr = NULL;
    if (rx->JobIds) {
       free_pool_memory(rx->JobIds);
       rx->JobIds = NULL;
@@ -272,6 +277,7 @@ static int user_select_jobids_or_files(UAContext *ua, RESTORE_CTX *rx)
 {
    char *p;
    char date[MAX_TIME_LENGTH];
+   bool have_date = false;
    JobId_t JobId;
    JOB_DBR jr;
    bool done = false;
@@ -284,6 +290,7 @@ static int user_select_jobids_or_files(UAContext *ua, RESTORE_CTX *rx)
       "Select the most recent backup for a client",
       "Select backup for a client before a specified time",
       "Enter a list of files to restore",
+      "Enter a list of files to restore before a specified time",
       "Cancel",
       NULL };
 
@@ -292,24 +299,26 @@ static int user_select_jobids_or_files(UAContext *ua, RESTORE_CTX *rx)
       "current",   /* 1 */
       "before",    /* 2 */
       "file",      /* 3 */
+      "select",    /* 4 */
       NULL
    };
 
+   *rx->JobIds = 0;
    switch (find_arg_keyword(ua, kw)) {
    case 0:                           /* jobid */
+      for ( ;; ) {
       i = find_arg_with_value(ua, _("jobid"));
       if (i < 0) {
-        return 0;
+           break;
       }
       pm_strcpy(&rx->JobIds, ua->argv[i]);
+         ua->argk[i][0] = 0;          /* "consume" jobid= */
+      }
       done = true;
       break;
    case 1:                           /* current */
       bstrutime(date, sizeof(date), time(NULL));
-      if (!select_backups_before_date(ua, rx, date)) {
-        return 0;
-      }
-      done = true;
+      have_date = true;
       break;
    case 2:                           /* before */
       i = find_arg_with_value(ua, _("before"));
@@ -321,12 +330,12 @@ static int user_select_jobids_or_files(UAContext *ua, RESTORE_CTX *rx)
         return 0;
       }
       bstrncpy(date, ua->argv[i], sizeof(date));
-      if (!select_backups_before_date(ua, rx, date)) {
-        return 0;
-      }
-      done = true;
+      have_date = true;
       break;
    case 3:                           /* file */
+      if (!have_date) {
+        bstrutime(date, sizeof(date), time(NULL));
+      }
       if (!get_client_name(ua, rx)) {
         return 0;
       }
@@ -336,12 +345,21 @@ static int user_select_jobids_or_files(UAContext *ua, RESTORE_CTX *rx)
            break;
         }
         pm_strcpy(&ua->cmd, ua->argv[i]);
-        insert_one_file(ua, rx);
-        ua->argk[i][0] = 0;
+        insert_one_file(ua, rx, date);
+         ua->argk[i][0] = 0;          /* "consume" the file= */
       }
       /* Check MediaType and select storage that corresponds */
       get_storage_from_mediatype(ua, &rx->name_list, rx);
       return 2;
+   case 4:                           /* select */
+      if (!have_date) {
+        bstrutime(date, sizeof(date), time(NULL));
+      }
+      if (!select_backups_before_date(ua, rx, date)) {
+        return 0;
+      }
+      done = true;
+      break;
    default:
       break;
    }
@@ -402,26 +420,44 @@ static int user_select_jobids_or_files(UAContext *ua, RESTORE_CTX *rx)
         }
         break;
       case 5:                        /* select backup at specified time */
-         bsendmsg(ua, _("The restored files will the most current backup\n"
-                        "BEFORE the date you specify below.\n\n"));
+        if (!get_date(ua, date, sizeof(date))) {
+           return 0;
+        }
+        if (!select_backups_before_date(ua, rx, date)) {
+           return 0;
+        }
+        break;
+      case 6:                        /* Enter files */
+        bstrutime(date, sizeof(date), time(NULL));
+        if (!get_client_name(ua, rx)) {
+           return 0;
+        }
+         bsendmsg(ua, _("Enter file names, or < to enter a filename\n"      
+                        "containg a list of file names, and terminate\n"
+                        "them with a blank line.\n"));
         for ( ;; ) {
-            if (!get_cmd(ua, _("Enter date as YYYY-MM-DD HH:MM:SS :"))) {
+            if (!get_cmd(ua, _("Enter filename: "))) {
               return 0;
            }
-           if (str_to_utime(ua->cmd) != 0) {
+           len = strlen(ua->cmd);
+           if (len == 0) {
               break;
            }
-            bsendmsg(ua, _("Improper date format.\n"));
+           insert_one_file(ua, rx, date);
         }              
-        bstrncpy(date, ua->cmd, sizeof(date));
-        if (!select_backups_before_date(ua, rx, date)) {
+        /* Check MediaType and select storage that corresponds */
+        get_storage_from_mediatype(ua, &rx->name_list, rx);
+        return 2;
+       case 7:                       /* enter files backed up before specified time */
+        if (!get_date(ua, date, sizeof(date))) {
            return 0;
         }
-        break;
-      case 6:                        /* Enter files */
         if (!get_client_name(ua, rx)) {
            return 0;
         }
+         bsendmsg(ua, _("Enter file names, or < to enter a filename\n"      
+                        "containg a list of file names, and terminate\n"
+                        "them with a blank line.\n"));
         for ( ;; ) {
             if (!get_cmd(ua, _("Enter filename: "))) {
               return 0;
@@ -430,13 +466,14 @@ static int user_select_jobids_or_files(UAContext *ua, RESTORE_CTX *rx)
            if (len == 0) {
               break;
            }
-           insert_one_file(ua, rx);
+           insert_one_file(ua, rx, date);
         }
         /* Check MediaType and select storage that corresponds */
         get_storage_from_mediatype(ua, &rx->name_list, rx);
         return 2;
       
-      case 7:                        /* Cancel or quit */
+      
+      case 8:                        /* Cancel or quit */
         return 0;
       }
    }
@@ -473,7 +510,24 @@ static int user_select_jobids_or_files(UAContext *ua, RESTORE_CTX *rx)
    return 1;
 }
 
-static void insert_one_file(UAContext *ua, RESTORE_CTX *rx)
+static int get_date(UAContext *ua, char *date, int date_len)
+{
+   bsendmsg(ua, _("The restored files will the most current backup\n"
+                  "BEFORE the date you specify below.\n\n"));
+   for ( ;; ) {
+      if (!get_cmd(ua, _("Enter date as YYYY-MM-DD HH:MM:SS :"))) {
+        return 0;
+      }
+      if (str_to_utime(ua->cmd) != 0) {
+        break;
+      }
+      bsendmsg(ua, _("Improper date format.\n"));
+   }             
+   bstrncpy(date, ua->cmd, date_len);
+   return 1;
+}
+
+static void insert_one_file(UAContext *ua, RESTORE_CTX *rx, char *date)
 {
    FILE *ffd;
    char file[5000];
@@ -490,14 +544,14 @@ static void insert_one_file(UAContext *ua, RESTORE_CTX *rx)
       }
       while (fgets(file, sizeof(file), ffd)) {
         line++;
-        if (!insert_file_into_findex_list(ua, rx, file)) {
+        if (!insert_file_into_findex_list(ua, rx, file, date)) {
             bsendmsg(ua, _("Error occurred on line %d of %s\n"), line, p);
         }
       }
       fclose(ffd);
       break;
    default:
-      insert_file_into_findex_list(ua, rx, ua->cmd);
+      insert_file_into_findex_list(ua, rx, ua->cmd, date);
       break;
    }
 }
@@ -507,12 +561,14 @@ static void insert_one_file(UAContext *ua, RESTORE_CTX *rx)
  *   lookup the most recent backup in the catalog to get the JobId
  *   and FileIndex, then insert them into the findex list.
  */
-static int insert_file_into_findex_list(UAContext *ua, RESTORE_CTX *rx, char *file)
+static int insert_file_into_findex_list(UAContext *ua, RESTORE_CTX *rx, char *file, 
+                                       char *date)
 {
    strip_trailing_junk(file);
    split_path_and_filename(rx, file);
-   Mmsg(&rx->query, uar_jobid_fileindex, rx->path, rx->fname, rx->ClientName);
+   Mmsg(&rx->query, uar_jobid_fileindex, date, rx->path, rx->fname, rx->ClientName);
    rx->found = false;
+   /* Find and insert jobid and File Index */
    if (!db_sql_query(ua->db, rx->query, jobid_fileindex_handler, (void *)rx)) {
       bsendmsg(ua, _("Query failed: %s. ERR=%s\n"), 
         rx->query, db_strerror(ua->db));
@@ -891,6 +947,7 @@ static void free_name_list(NAME_LIST *name_list)
    }
    if (name_list->name) {
       free(name_list->name);
+      name_list->name = NULL;
    }
    name_list->max_ids = 0;
    name_list->num_ids = 0;
index 9a4a559dce2ef671ab54774c901de0202409900d..f54eaf22a36bc4080879ce3327ce72adf691fac6 100644 (file)
@@ -44,7 +44,7 @@ extern struct s_kw ReplaceOptions[];
  *     run <job-name> jobid=nn
  *
  */
-int runcmd(UAContext *ua, char *cmd)
+int run_cmd(UAContext *ua, char *cmd)
 {
    JCR *jcr;
    char *job_name, *level_name, *jid, *store_name, *pool_name;
@@ -71,9 +71,11 @@ int runcmd(UAContext *ua, char *cmd)
       N_("when"),
       N_("priority"),
       N_("yes"),          /* 12 -- if you change this change YES_POS too */
+      N_("run"),          /* 13 -- if you change this change RUN_POS too */
       NULL};
 
 #define YES_POS 12
+#define RUN_POS 13
 
    if (!open_db(ua)) {
       return 1;
@@ -96,8 +98,8 @@ int runcmd(UAContext *ua, char *cmd)
       Dmsg2(200, "Doing arg %d = %s\n", i, ua->argk[i]);
       for (j=0; !found && kw[j]; j++) {
         if (strcasecmp(ua->argk[i], _(kw[j])) == 0) {
-           /* Note, yes has no value, so do not err */
-           if (!ua->argv[i] && j != YES_POS /*yes*/) {
+           /* Note, yes and run have no value, so do not err */
+           if (!ua->argv[i] && (j != YES_POS /*yes*/ && j != RUN_POS)) {  
                bsendmsg(ua, _("Value missing for keyword %s\n"), ua->argk[i]);
               return 1;
            }
@@ -203,6 +205,7 @@ int runcmd(UAContext *ua, char *cmd)
               }
               break;
            case 12: /* yes */
+           case 13: /* run */
               found = True;
               break;
            default:
@@ -554,6 +557,7 @@ Priority:   %d\n"),
             add_prompt(ua, _("Initialize Catalog"));
             add_prompt(ua, _("Verify Catalog"));
             add_prompt(ua, _("Verify Volume to Catalog"));
+            add_prompt(ua, _("Verify Disk to Catalog"));
             add_prompt(ua, _("Verify Volume Data (not yet implemented)"));
             switch (do_prompt(ua, "",  _("Select level"), NULL, 0)) {
            case 0:
@@ -566,6 +570,9 @@ Priority:   %d\n"),
               jcr->JobLevel = L_VERIFY_VOLUME_TO_CATALOG;
               break;
            case 3:
+              jcr->JobLevel = L_VERIFY_DISK_TO_CATALOG;
+              break;
+           case 4:
               jcr->JobLevel = L_VERIFY_DATA;
               break;
            default:
index f3afec0d056e8f8e5e52c4aa40c3bd20b6e2b3ed..3bef0d2bcf8368fe2f957bc199a9047b2e1a1c5f 100644 (file)
@@ -84,6 +84,12 @@ int find_arg_keyword(UAContext *ua, char **list)
    return -1;
 }
 
+/* 
+ * Given one keyword, find the first one that
+ *   is in the argument list.
+ * Returns: argk index (always gt 0)
+ *         -1 if not found
+ */
 int find_arg(UAContext *ua, char *keyword)
 {
    for (int i=1; i<ua->argc; i++) {
@@ -341,7 +347,7 @@ int select_client_dbr(UAContext *ua, CLIENT_DBR *cr)
       return 0;
    }
    if (num_clients <= 0) {
-      bsendmsg(ua, _("No clients defined. Run a job to create one.\n"));
+      bsendmsg(ua, _("No clients defined. You must run a job before using this command.\n"));
       return 0;
    }
      
index 44ca5bac40e3e3e7b288f1a5e1bc726e23ab3074..2d8c59c6e447acea233c6e4230ada45c77f95e5d 100644 (file)
@@ -433,103 +433,31 @@ static void prt_runtime(UAContext *ua, JOB *job, int level, time_t runtime, POOL
  */
 static void print_jobs_scheduled(UAContext *ua)
 {
-   time_t now, runtime, tomorrow;
+   time_t runtime;
    RUN *run;
    JOB *job;
-   SCHED *sched;
-   struct tm tm;
-   int mday, wday, month, wpos, tmday, twday, tmonth, twpos, i, hour;
-   int tod, tom;
-   int found;
-   int hdr_printed = FALSE;
+   bool hdr_printed = false;
    int level;
 
    Dmsg0(200, "enter find_runs()\n");
 
-   now = time(NULL);
-   localtime_r(&now, &tm);
-   mday = tm.tm_mday - 1;
-   wday = tm.tm_wday;
-   month = tm.tm_mon;
-   wpos = (tm.tm_mday - 1) / 7;
-
-   tomorrow = now + 60 * 60 * 24;
-   localtime_r(&tomorrow, &tm);
-   tmday = tm.tm_mday - 1;
-   twday = tm.tm_wday;
-   tmonth = tm.tm_mon;
-   twpos  = (tm.tm_mday - 1) / 7;
-
    /* Loop through all jobs */
    LockRes();
    for (job=NULL; (job=(JOB *)GetNextRes(R_JOB, (RES *)job)); ) {
       level = job->level;   
-      sched = job->schedule;
-      if (sched == NULL) {           /* scheduled? */
-        continue;                    /* no, skip this job */
+      run = find_next_run(job, runtime);
+      if (!run) {
+        continue;
       }
-      for (run=sched->run; run; run=run->next) {
-        if (run->level) {
-           level = run->level;
-        }
-        /* 
-         * Find runs in next 24 hours
-         */
-        tod = (bit_is_set(mday, run->mday) || bit_is_set(wday, run->wday)) && 
-               bit_is_set(month, run->month) && bit_is_set(wpos, run->wpos);
-
-        tom = (bit_is_set(tmday, run->mday) || bit_is_set(twday, run->wday)) &&
-               bit_is_set(tmonth, run->month) && bit_is_set(wpos, run->wpos);
-
-         Dmsg2(200, "tod=%d tom=%d\n", tod, tom);
-        found = FALSE;
-        if (tod) {                   /* Jobs scheduled today (next 24 hours) */
-           /* find time (time_t) job is to be run */
-           localtime_r(&now, &tm);
-           hour = 0;
-           for (i=tm.tm_hour; i < 24; i++) {
-              if (bit_is_set(i, run->hour)) {
-                 tm.tm_hour = i;
-                 tm.tm_min = run->minute;
-                 tm.tm_sec = 0;
-                 runtime = mktime(&tm);
-                 if (runtime > now) {
-                    if (!hdr_printed) {
-                       hdr_printed = TRUE;
-                       prt_runhdr(ua);
-                    }
-                    prt_runtime(ua, job, level, runtime, run->pool);
-                    found = TRUE;
-                    break;
-                 }
-              }
-           }
-        }
+      if (run->level) {
+        level = run->level;
+      }
+      if (!hdr_printed) {
+        hdr_printed = true;
+        prt_runhdr(ua);
+      }
+      prt_runtime(ua, job, level, runtime, run->pool);
 
-//       Dmsg2(200, "runtime=%d now=%d\n", runtime, now);
-        if (!found && tom) {            /* look at jobs scheduled tomorrow */
-           localtime_r(&tomorrow, &tm);
-           hour = 0;
-           for (i=0; i < 24; i++) {
-              if (bit_is_set(i, run->hour)) {
-                 hour = i;
-                 break;
-              }
-           }
-           tm.tm_hour = hour;
-           tm.tm_min = run->minute;
-           tm.tm_sec = 0;
-           runtime = mktime(&tm);
-            Dmsg2(200, "truntime=%d now=%d\n", runtime, now);
-           if (runtime < tomorrow) {
-              if (!hdr_printed) {
-                 hdr_printed = TRUE;
-                 prt_runhdr(ua);
-              }
-              prt_runtime(ua, job, level, runtime, run->pool);
-           }
-        }
-      } /* end for loop over runs */ 
    } /* end for loop over resources */
    UnlockRes();
    Dmsg0(200, "Leave find_runs()\n");
index 40faac1e41f1669c9af3e6688d8be073dc42ad7d..fd8ddeb1abd6453e65844d463ce06e2c72ab42e5 100644 (file)
@@ -262,6 +262,9 @@ int do_verify(JCR *jcr)
    case L_VERIFY_DATA:
       level = "data";
       break;
+   case L_VERIFY_DISK_TO_CATALOG:
+      level="disk_to_catalog";
+      break;
    default:
       Jmsg1(jcr, M_FATAL, 0, _("Unimplemented save level %d\n"), jcr->JobLevel);
       goto bail_out;
@@ -298,6 +301,11 @@ int do_verify(JCR *jcr)
       get_attributes_and_compare_to_catalog(jcr, JobId);
       break;
 
+   case L_VERIFY_DISK_TO_CATALOG:
+      Dmsg0(10, "Verify level=disk_to_catalog\n");
+      get_attributes_and_compare_to_catalog(jcr, JobId);
+      break;
+
    case L_VERIFY_INIT:
       /* Build catalog */
       Dmsg0(10, "Verify level=init\n");
index f97f16974f82bad78c1affae2a04da2a15b156e6..9edec269560cbd90ebcbbed7c91b636d7a70c32e 100644 (file)
@@ -7,3 +7,4 @@ host.h
 startit
 static-bacula-fd
 stopit
+filed.conf
index e79f6142bde2ba7147177c446da2af736a9a2830..1f9662d4bafb62b0d6325611784e86448bcc21d2 100644 (file)
@@ -1049,6 +1049,7 @@ static void filed_free_jcr(JCR *jcr)
    if (jcr->RestoreBootstrap) {
       unlink(jcr->RestoreBootstrap);
       free_pool_memory(jcr->RestoreBootstrap);
+      jcr->RestoreBootstrap = NULL;
    }
    if (jcr->last_fname) {
       free_pool_memory(jcr->last_fname);
@@ -1096,6 +1097,7 @@ static int send_bootstrap_file(JCR *jcr)
    char buf[2000];
    BSOCK *sd = jcr->store_bsock;
    char *bootstrap = "bootstrap\n";
+   int stat = 0;
 
    Dmsg1(400, "send_bootstrap_file: %s\n", jcr->RestoreBootstrap);
    if (!jcr->RestoreBootstrap) {
@@ -1106,7 +1108,7 @@ static int send_bootstrap_file(JCR *jcr)
       Jmsg(jcr, M_FATAL, 0, _("Could not open bootstrap file %s: ERR=%s\n"), 
         jcr->RestoreBootstrap, strerror(errno));
       set_jcr_job_status(jcr, JS_ErrorTerminated);
-      return 0;
+      goto bail_out;
    }
    pm_strcpy(&sd->msg, bootstrap);  
    sd->msglen = strlen(sd->msg);
@@ -1119,7 +1121,16 @@ static int send_bootstrap_file(JCR *jcr)
    fclose(bs);
    if (!response(jcr, sd, OKSDbootstrap, "Bootstrap")) {
       set_jcr_job_status(jcr, JS_ErrorTerminated);
-      return 0;
+      goto bail_out;
    }
-   return 1;
+   stat = 1;
+
+bail_out:
+   if (jcr->RestoreBootstrap) {
+      unlink(jcr->RestoreBootstrap);
+      free_pool_memory(jcr->RestoreBootstrap);
+      jcr->RestoreBootstrap = NULL;
+   }
+
+   return stat;
 }
index 068306b060330a26d2dd2600516fe1e114c4247f..b7bb63320aa2f5c7229f3b6969f2d82146c0672f 100644 (file)
@@ -33,6 +33,7 @@
 static char rec_header[] = "rechdr %ld %ld %ld %ld %ld";
 
 /* Forward referenced functions */
+static char *zlib_strerror(int stat);
 
 #define RETRY 10                     /* retry wait time */
 
@@ -47,7 +48,7 @@ void do_restore(JCR *jcr)
    uint32_t size;
    uint32_t VolSessionId, VolSessionTime;
    int32_t file_index;
-   int extract = FALSE;
+   bool extract = false;
    BFILE bfd;
    int stat;
    uint32_t total = 0;               /* Job total but only 32 bits for debug */
@@ -125,7 +126,7 @@ void do_restore(JCR *jcr)
                Jmsg0(jcr, M_ERROR, 0, _("Logic error output file should be open\n"));
            }
            set_attributes(jcr, attr, &bfd);
-           extract = FALSE;
+           extract = false;
             Dmsg0(30, "Stop extracting.\n");
         }
 
@@ -157,14 +158,14 @@ void do_restore(JCR *jcr)
         jcr->num_files_examined++;
 
          Dmsg1(30, "Outfile=%s\n", attr->ofname);
-        extract = FALSE;
+        extract = false;
         stat = create_file(jcr, attr, &bfd, jcr->replace);
         switch (stat) {
         case CF_ERROR:
         case CF_SKIP:
            break;
         case CF_EXTRACT:
-           extract = TRUE;
+           extract = true;
            P(jcr->mutex);
            pm_strcpy(&jcr->last_fname, attr->ofname);
            V(jcr->mutex);
@@ -206,7 +207,8 @@ void do_restore(JCR *jcr)
                  if (blseek(&bfd, (off_t)fileAddr, SEEK_SET) < 0) {
                      Jmsg3(jcr, M_ERROR, 0, _("Seek to %s error on %s: ERR=%s\n"),
                         edit_uint64(fileAddr, ec1), attr->ofname, berror(&bfd));
-                    extract = FALSE;
+                    extract = false;
+                    bclose(&bfd);
                     continue;
                  }
               }
@@ -218,7 +220,8 @@ void do_restore(JCR *jcr)
            if ((uint32_t)bwrite(&bfd, wbuf, wsize) != wsize) {
                Dmsg0(0, "===Write error===\n");
                Jmsg2(jcr, M_ERROR, 0, _("Write error on %s: ERR=%s\n"), attr->ofname, berror(&bfd));
-              extract = FALSE;
+              extract = false;
+              bclose(&bfd);
               continue;
            } 
            total += wsize;
@@ -250,7 +253,8 @@ void do_restore(JCR *jcr)
                  if (blseek(&bfd, (off_t)fileAddr, SEEK_SET) < 0) {
                      Jmsg3(jcr, M_ERROR, 0, _("Seek to %s error on %s: ERR=%s\n"),
                         edit_uint64(fileAddr, ec1), attr->ofname, berror(&bfd));
-                    extract = FALSE;
+                    extract = false;
+                    bclose(&bfd);
                     continue;
                  }
               }
@@ -262,8 +266,10 @@ void do_restore(JCR *jcr)
             Dmsg2(100, "Comp_len=%d msglen=%d\n", compress_len, wsize);
            if ((stat=uncompress((Byte *)jcr->compress_buf, &compress_len, 
                  (const Byte *)wbuf, (uLong)wsize)) != Z_OK) {
-               Jmsg(jcr, M_ERROR, 0, _("Uncompression error. ERR=%d\n"), stat);
-              extract = FALSE;
+               Jmsg(jcr, M_ERROR, 0, _("Uncompression error on file %s. ERR=%s\n"), 
+                 attr->ofname, zlib_strerror(stat));
+              extract = false;
+              bclose(&bfd);
               continue;
            }
 
@@ -271,7 +277,8 @@ void do_restore(JCR *jcr)
            if ((uLong)bwrite(&bfd, jcr->compress_buf, compress_len) != compress_len) {
                Dmsg0(0, "===Write error===\n");
                Jmsg2(jcr, M_ERROR, 0, _("Write error on %s: %s\n"), attr->ofname, berror(&bfd));
-              extract = FALSE;
+              extract = false;
+              bclose(&bfd);
               continue;
            }
            total += compress_len;
@@ -282,7 +289,8 @@ void do_restore(JCR *jcr)
 #else
         if (extract) {
             Jmsg(jcr, M_ERROR, 0, _("GZIP data stream found, but GZIP not configured!\n"));
-           extract = FALSE;
+           extract = false;
+           bclose(&bfd);
            continue;
         }
 #endif
@@ -308,7 +316,7 @@ void do_restore(JCR *jcr)
                Jmsg0(jcr, M_ERROR, 0, _("Logic error output file should be open but is not.\n"));
            }
            set_attributes(jcr, attr, &bfd);
-           extract = FALSE;
+           extract = false;
         }
          Jmsg(jcr, M_ERROR, 0, _("Unknown stream=%d ignored. This shouldn't happen!\n"), stream);
          Dmsg2(0, "None of above!!! stream=%d data=%s\n", stream,sd->msg);
@@ -333,6 +341,7 @@ ok_out:
       free(jcr->compress_buf);
       jcr->compress_buf = NULL;
    }
+   bclose(&bfd);
    free_attr(attr);
    Dmsg2(10, "End Do Restore. Files=%d Bytes=%" lld "\n", jcr->JobFiles,
       jcr->JobBytes);
@@ -341,3 +350,29 @@ ok_out:
         non_support_data, non_support_attr);
    }
 }         
+
+/*
+ * Convert ZLIB error code into an ASCII message
+ */
+static char *zlib_strerror(int stat)
+{
+   if (stat >= 0) {
+      return "None";
+   }
+   switch (stat) {
+   case Z_ERRNO:
+      return "Zlib errno";
+   case Z_STREAM_ERROR:
+      return "Zlib stream error";
+   case Z_DATA_ERROR:
+      return "Zlib data error";
+   case Z_MEM_ERROR:
+      return "Zlib memory error";
+   case Z_BUF_ERROR:
+      return "Zlib buffer error";
+   case Z_VERSION_ERROR:
+      return "Zlib version error";
+   default:
+      return "*none*";
+   }
+}
index 27d92542624ebda39026ee08800cee9853a41d46..f0d65be64cebafa9eb498af37b99a9763de1e6e9 100755 (executable)
@@ -241,6 +241,7 @@ int set_attributes(JCR *jcr, ATTR *attr, BFILE *ofd)
       if (is_bopen(ofd)) {
         bclose(ofd); 
       }
+      pm_strcpy(&attr->ofname, "*none*");
       return 1;
    }
 
@@ -249,6 +250,7 @@ int set_attributes(JCR *jcr, ATTR *attr, BFILE *ofd)
       if (is_bopen(ofd)) {
         bclose(ofd); 
       }
+      pm_strcpy(&attr->ofname, "*none*");
       return 1;
    }
    /*
@@ -307,6 +309,7 @@ int set_attributes(JCR *jcr, ATTR *attr, BFILE *ofd)
         stat = 0;
       }
    }
+   pm_strcpy(&attr->ofname, "*none*");
    umask(old_mask);
    return stat;
 }
index 3f2c9539006b6efd9c3f0a355ceec923db7094ae..2ade59f41fb7f7737b6fbae8a92b667a1400e9e8 100644 (file)
@@ -477,14 +477,21 @@ int bopen(BFILE *bfd, const char *fname, int flags, mode_t mode)
 {
    bfd->fid = open(fname, flags, mode);
    bfd->berrno = errno;
+   Dmsg1(50, "Open file %d\n", bfd->fid);
    return bfd->fid;
 }
 
 int bclose(BFILE *bfd)
 { 
-   int stat = close(bfd->fid);
+   int stat;  
+   Dmsg1(50, "Close file %d\n", bfd->fid);
+   if (bfd->fid == -1) {
+      return 0;
+   }
+   stat = close(bfd->fid);
    bfd->berrno = errno;
    bfd->fid = -1;
+
    return stat;
 }
 
index 2900f998d9c0eee9a01cac18062cb9d7438a4344..766120df91609dea4be2a6347c58609c9b6a9501 100644 (file)
@@ -170,6 +170,9 @@ int create_file(JCR *jcr, ATTR *attr, BFILE *bfd, int replace)
            mode |= O_CTG;               /* set contiguous bit if needed */
         }
          Dmsg1(50, "Create file: %s\n", attr->ofname);
+        if (is_bopen(bfd)) {
+            Jmsg1(jcr, M_ERROR, 0, "bpkt already open fid=%d\n", bfd->fid);
+        }
         if ((bopen(bfd, attr->ofname, mode, S_IRUSR | S_IWUSR)) < 0) {
             Jmsg2(jcr, M_ERROR, 0, _("Could not create %s: ERR=%s\n"), 
                  attr->ofname, berror(bfd));
@@ -205,6 +208,9 @@ int create_file(JCR *jcr, ATTR *attr, BFILE *bfd, int replace)
            } else {
               tid = NULL;
            }
+           if (is_bopen(bfd)) {
+               Jmsg1(jcr, M_ERROR, 0, "bpkt already open fid=%d\n", bfd->fid);
+           }
            if ((bopen(bfd, attr->ofname, mode, 0)) < 0) {
                Jmsg2(jcr, M_ERROR, 0, _("Could not open %s: ERR=%s\n"), 
                     attr->ofname, berror(bfd));
@@ -248,6 +254,9 @@ int create_file(JCR *jcr, ATTR *attr, BFILE *bfd, int replace)
        *   and saved.
        */
       if (!is_portable_backup(bfd)) {
+        if (is_bopen(bfd)) {
+            Jmsg1(jcr, M_ERROR, 0, "bpkt already open fid=%d\n", bfd->fid);
+        }
         if ((bopen(bfd, attr->ofname, O_WRONLY|O_BINARY, 0)) < 0) {
             Jmsg2(jcr, M_ERROR, 0, _("Could not open %s: ERR=%s\n"), 
                  attr->ofname, berror(bfd));
diff --git a/bacula/src/gnome2-console/.cvsignore b/bacula/src/gnome2-console/.cvsignore
deleted file mode 100644 (file)
index b8893fb..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-test-gnome-console.conf
-Makefile
-gnome-console
-gnome-console.conf
-1
-2
-3
index e3e012b61cd80f8747cd63bf3cc9c45fde98b4d6..ed365335019bba1c27dd294528d0935464f1c2a2 100644 (file)
@@ -40,6 +40,7 @@
 #define L_VERIFY_CATALOG         'C'  /* verify from catalog */
 #define L_VERIFY_INIT            'V'  /* verify save (init DB) */
 #define L_VERIFY_VOLUME_TO_CATALOG 'O'  /* verify Volume to catalog entries */
+#define L_VERIFY_DISK_TO_CATALOG 'd'  /* verify Disk attributes to catalog */
 #define L_VERIFY_DATA            'A'  /* verify data on volume */
 #define L_BASE                   'B'  /* Base level job */
 
index 6b612deb0a711cead969af7704a73fac5ec104af..4c272f9f536b2e48201f7eee7a137ee2874dbd1e 100755 (executable)
@@ -284,7 +284,7 @@ static void scan_types(LEX *lc, MSGS *msg, int dest_code, char *where, char *cmd
         str = &lc->str[0];
       }
       for (i=0; msg_types[i].name; i++) {
-        if (strcmp(str, msg_types[i].name) == 0) {
+        if (strcasecmp(str, msg_types[i].name) == 0) {
            msg_type = msg_types[i].token;
            found = TRUE;
            break;
index 9c1ce536c37deb4b07bb1ecaa14686ac2ad32f10..3e335fb4f178caa9da3e5716da0f813adb906562 100644 (file)
 /* Return true of buffer has all zero bytes */
 int is_buf_zero(char *buf, int len)
 {
-   uint64_t *ip = (uint64_t *)buf;
+   uint64_t *ip;
    char *p;
    int i, len64, done, rem;
 
+   if (buf[0] != 0) {
+      return 0;
+   }
+   ip = (uint64_t *)buf;
    /* Optimize by checking uint64_t for zero */
-   len64 = len >> sizeof(uint64_t);
+   len64 = len / sizeof(uint64_t);
    for (i=0; i < len64; i++) {
       if (ip[i] != 0) {
         return 0;
       }
    }
-   done = len64 << sizeof(uint64_t);  /* bytes already checked */
+   done = len64 * sizeof(uint64_t);  /* bytes already checked */
    p = buf + done;
    rem = len - done;
    for (i = 0; i < rem; i++) {
index a3104e4eea6a16636c48efe197384edd67ccf186..6f6270578fdc330431456391701940e0467a6cdd 100644 (file)
@@ -18,3 +18,4 @@ startit
 stopit
 changer.out
 mtx-changer
+stored.conf
index 36a4a45ce596fa54eeb7745270d7b1638783a44d..fc9452c16a2c0d620f6ddbd8f1c6d565d6f2bc8f 100644 (file)
@@ -57,11 +57,11 @@ static void usage()
 "Usage: bcopy [-d debug_level] <input-archive> <output-archive>\n"
 "       -b bootstrap      specify a bootstrap file\n"
 "       -c <file>         specify configuration file\n"
-"       -dnn              set debug level to nn\n"
+"       -d <nn>           set debug level to nn\n"
 "       -v                verbose\n"
 "       -i                specify input Volume names (separated by |)\n"
 "       -o                specify output Volume names (separated by |)\n"
-"       -w dir            specify working directory (default /tmp)\n"
+"       -w <dir>          specify working directory (default /tmp)\n"
 "       -?                print this message\n\n"));
    exit(1);
 }
index 6f058b4c4a0f7ddeb8bdb660f361a258629635e6..3b8d4794fdde839bcc0d1048305fff84f4d13171 100644 (file)
@@ -71,13 +71,13 @@ static void usage()
 {
    fprintf(stderr,
 "\nVersion: " VERSION " (" BDATE ")\n\n"
-"Usage: bextract [-d debug_level] <bacula-archive> <directory-to-store-files>\n"
+"Usage: bextract <options> <bacula-archive-device-name> <directory-to-store-files>\n"
 "       -b <file>       specify a bootstrap file\n"
 "       -c <file>       specify a configuration file\n"
-"       -dnn            set debug level to nn\n"
+"       -d <nn>         set debug level to nn\n"
 "       -e <file>       exclude list\n"
 "       -i <file>       include list\n"
-"       -V              specify Volume names (separated by |)\n"
+"       -V <volumes>    specify Volume names (separated by |)\n"
 "       -?              print this message\n\n");
    exit(1);
 }
index bdb2fab3834557dfae9dd5d6d95e6dae2c607d36..358ff6ec998065b4e6775acb839e9f95753008fb 100644 (file)
@@ -399,7 +399,8 @@ int write_block_to_dev(JCR *jcr, DEVICE *dev, DEV_BLOCK *block)
       Jmsg(jcr, M_INFO, 0, _("User defined maximum volume capacity %s exceeded on device %s.\n"),
            edit_uint64(max_cap, ed1),  dev->dev_name);
       block->write_failed = true;
-      weof_dev(dev, 2);              /* end the tape */
+      weof_dev(dev, 1);              /* end the tape */
+      weof_dev(dev, 1);
       dev->state |= (ST_EOF | ST_EOT | ST_WEOT);
       return 0;   
    }
@@ -472,7 +473,8 @@ int write_block_to_dev(JCR *jcr, DEVICE *dev, DEV_BLOCK *block)
         wlen, stat, dev->block_num, block->BlockNumber, dev->dev_errno, strerror(dev->dev_errno));
 
       block->write_failed = true;
-      if (weof_dev(dev, 2) != 0) {        /* end the tape */
+      weof_dev(dev,1);
+      if (weof_dev(dev, 1) != 0) {        /* end the tape */
          Jmsg(jcr, M_ERROR, 0, "%s", dev->errmsg);
       }
       dev->state |= (ST_EOF | ST_EOT | ST_WEOT);
@@ -489,12 +491,12 @@ int write_block_to_dev(JCR *jcr, DEVICE *dev, DEV_BLOCK *block)
       if (dev->state & ST_TAPE && dev_cap(dev, CAP_BSR)) {
 
         /* Now back up over what we wrote and read the last block */
-        if (bsf_dev(dev, 1) != 0 || bsf_dev(dev, 1) != 0) {
+        if (!bsf_dev(dev, 1) || !bsf_dev(dev, 1)) {
            ok = false;
             Jmsg(jcr, M_ERROR, 0, _("Backspace file at EOT failed. ERR=%s\n"), strerror(dev->dev_errno));
         }
         /* Backspace over record */
-        if (ok && bsr_dev(dev, 1) != 0) {
+        if (ok && !bsr_dev(dev, 1)) {
            ok = false;
             Jmsg(jcr, M_ERROR, 0, _("Backspace record at EOT failed. ERR=%s\n"), strerror(dev->dev_errno));
            /*
@@ -585,7 +587,7 @@ int read_block_from_dev(JCR *jcr, DEVICE *dev, DEV_BLOCK *block, bool check_bloc
    ssize_t stat;
    int looping;
    uint32_t BlockNumber;
-   int retry = 0;
+   int retry;
 
    if (dev_state(dev, ST_EOT)) {
       return 0;
@@ -601,12 +603,14 @@ reread:
       block->read_len = 0;
       return 0;
    }
+   retry = 0;
    do {
       stat = read(dev->fd, block->buf, (size_t)block->buf_len);
       if (retry == 1) {
         dev->VolCatInfo.VolCatErrors++;   
       }
    } while (stat == -1 && (errno == EINTR || errno == EIO) && retry++ < 11);
+// Dmsg1(000, "read stat = %d\n", stat);
    if (stat < 0) {
       Dmsg1(90, "Read device got: ERR=%s\n", strerror(errno));
       clrerror_dev(dev, -1);
@@ -664,8 +668,8 @@ reread:
       /* Attempt to reposition to re-read the block */
       if (dev->state & ST_TAPE) {
          Dmsg0(100, "Backspace record for reread.\n");
-        if (bsr_dev(dev, 1) != 0) {
-            Jmsg(jcr, M_ERROR, 0, "%s", dev->errmsg);
+        if (!bsr_dev(dev, 1)) {
+            Jmsg(jcr, M_ERROR, 0, "%s", strerror_dev(dev));
            block->read_len = 0;
            return 0;
         }
index 897ff9e66464bcb8438d78f28edd2c813765705e..1bf6a8836bd50bdc2cf477de65be599d9c0b5209 100644 (file)
@@ -102,17 +102,17 @@ static void usage()
 "Usage: bscan [-d debug_level] <bacula-archive>\n"
 "       -b bootstrap      specify a bootstrap file\n"
 "       -c <file>         specify configuration file\n"
-"       -dnn              set debug level to nn\n"
+"       -d <nn>           set debug level to nn\n"
 "       -m                update media info in database\n"
-"       -n name           specify the database name (default bacula)\n"
-"       -u user           specify database user name (default bacula)\n"
-"       -p password       specify database password (default none)\n"
-"       -h host           specify database host (default NULL)\n"
+"       -n <name>         specify the database name (default bacula)\n"
+"       -u <user>         specify database user name (default bacula)\n"
+"       -p <password      specify database password (default none)\n"
+"       -h <host>         specify database host (default NULL)\n"
 "       -r                list records\n"
 "       -s                synchronize or store in database\n"
 "       -v                verbose\n"
-"       -V                specify Volume names (separated by |)\n"
-"       -w dir            specify working directory (default from conf file)\n"
+"       -V <Volumes>      specify Volume names (separated by |)\n"
+"       -w <dir>          specify working directory (default from conf file)\n"
 "       -?                print this message\n\n"));
    exit(1);
 }
index 7b2c5642fedf6c3558b903e648f9b367de405462..c6625c05dd8ecab0e4c185a26a2803afec24331e 100644 (file)
@@ -414,7 +414,7 @@ static void weofcmd()
 static void eomcmd()
 {
    if (!eod_dev(dev)) {
-      Pmsg1(0, _("Bad status from MTEOD. ERR=%s\n"), strerror_dev(dev));
+      Pmsg1(0, "%s", strerror_dev(dev));
       return;
    } else {
       Pmsg0(0, _("Moved to end of medium.\n"));
@@ -435,10 +435,9 @@ static void eodcmd()
  */
 static void bsfcmd()
 {
-   int stat;
 
-   if ((stat=bsf_dev(dev, 1)) < 0) {
-      Pmsg1(0, _("Bad status from bsf. ERR=%s\n"), strerror(errno));
+   if (!bsf_dev(dev, 1)) {
+      Pmsg1(0, _("Bad status from bsf. ERR=%s\n"), strerror_dev(dev));
    } else {
       Pmsg0(0, _("Backspaced one file.\n"));
    }
@@ -449,10 +448,8 @@ static void bsfcmd()
  */
 static void bsrcmd()
 {
-   int stat;
-
-   if ((stat=bsr_dev(dev, 1)) < 0) {
-      Pmsg1(0, _("Bad status from bsr. ERR=%s\n"), strerror(errno));
+   if (!bsr_dev(dev, 1)) {
+      Pmsg1(0, _("Bad status from bsr. ERR=%s\n"), strerror_dev(dev));
    } else {
       Pmsg0(0, _("Backspaced one record.\n"));
    }
@@ -464,7 +461,7 @@ static void bsrcmd()
  */
 static void capcmd()
 {
-   printf(_("Device capabilities:\n"));
+   printf(_("Configured device capabilities:\n"));
    printf("%sEOF ", dev->capabilities & CAP_EOF ? "" : "!");
    printf("%sBSR ", dev->capabilities & CAP_BSR ? "" : "!");
    printf("%sBSF ", dev->capabilities & CAP_BSF ? "" : "!");
@@ -613,17 +610,17 @@ static int re_read_block_test()
    }
    weofcmd();
    weofcmd();
-   if (bsf_dev(dev, 1) != 0) {
-      Pmsg1(0, _("Backspace file failed! ERR=%s\n"), strerror(dev->dev_errno));
+   if (!bsf_dev(dev, 1)) {
+      Pmsg1(0, _("Backspace file failed! ERR=%s\n"), strerror_dev(dev));
       goto bail_out;
    }
-   if (bsf_dev(dev, 1) != 0) {
-      Pmsg1(0, _("Backspace file failed! ERR=%s\n"), strerror(dev->dev_errno));
+   if (!bsf_dev(dev, 1)) {
+      Pmsg1(0, _("Backspace file failed! ERR=%s\n"), strerror_dev(dev));
       goto bail_out;
    }
    Pmsg0(0, "Backspaced over two EOFs OK.\n");
-   if (bsr_dev(dev, 1) != 0) {
-      Pmsg1(0, _("Backspace record failed! ERR=%s\n"), strerror(dev->dev_errno));
+   if (!bsr_dev(dev, 1)) {
+      Pmsg1(0, _("Backspace record failed! ERR=%s\n"), strerror_dev(dev));
       goto bail_out;
    }
    Pmsg0(0, "Backspace record OK.\n");
@@ -1735,6 +1732,7 @@ static void helpcmd()
 {
    unsigned int i;
    usage();
+   printf(_("Interactive commands:\n"));
    printf(_("  Command    Description\n  =======    ===========\n"));
    for (i=0; i<comsize; i++)
       printf("  %-10s %s\n", commands[i].key, commands[i].help);
@@ -1745,9 +1743,9 @@ static void usage()
 {
    fprintf(stderr, _(
 "\nVersion: " VERSION " (" BDATE ")\n\n"
-"Usage: btape [-c config_file] [-d debug_level] [device_name]\n"
+"Usage: btape <options> <device_name>\n"
 "       -c <file>   set configuration file to file\n"
-"       -dnn        set debug level to nn\n"
+"       -d <nn>     set debug level to nn\n"
 "       -s          turn off signals\n"
 "       -t          open the default tape device\n"
 "       -?          print this message.\n"  
index dfde94eba213e7665237b828628ee44912383371..bf7eb065fb69e07cfddcefcb2d8c9bfb74395d6c 100644 (file)
@@ -418,6 +418,9 @@ eod_dev(DEVICE *dev)
         dev->state |= ST_EOT;
         return 1;
       }
+      dev->dev_errno = errno;
+      Mmsg2(&dev->errmsg, _("lseek error on %s. ERR=%s.\n"),
+            dev->dev_name, strerror(dev->dev_errno));
       return 0;
    }
 #ifdef MTEOM
@@ -465,7 +468,7 @@ eod_dev(DEVICE *dev)
     * the second EOF.
     */
    if (dev_cap(dev, CAP_BSFATEOM)) {
-      stat =  (bsf_dev(dev, 1) == 0);
+      stat =  bsf_dev(dev, 1);
       dev->file++;                   /* keep same file */
    } else {
       update_pos_dev(dev);                  /* update position */
@@ -830,12 +833,14 @@ bsf_dev(DEVICE *dev, int num)
 
    if (dev->fd < 0) {
       dev->dev_errno = EBADF;
-      Mmsg0(&dev->errmsg, _("Bad call to bsf_dev. Archive not open\n"));
+      Mmsg0(&dev->errmsg, _("Bad call to bsf_dev. Archive device not open\n"));
       Emsg0(M_FATAL, 0, dev->errmsg);
       return 0;
    }
 
    if (!(dev_state(dev, ST_TAPE))) {
+      Mmsg1(&dev->errmsg, _("Device %s cannot BSF because it is not a tape.\n"),
+        dev->dev_name);
       return 0;
    }
    Dmsg0(29, "bsf_dev\n");
@@ -1002,7 +1007,7 @@ weof_dev(DEVICE *dev, int num)
 
    if (dev->fd < 0) {
       dev->dev_errno = EBADF;
-      Mmsg0(&dev->errmsg, _("Bad call to weof_dev. Archive not open\n"));
+      Mmsg0(&dev->errmsg, _("Bad call to weof_dev. Archive drive not open\n"));
       Emsg0(M_FATAL, 0, dev->errmsg);
       return -1;
    }
@@ -1021,8 +1026,10 @@ weof_dev(DEVICE *dev, int num)
       dev->file_addr = 0;
    } else {
       clrerror_dev(dev, MTWEOF);
+      if (stat == -1) {
       Mmsg2(&dev->errmsg, _("ioctl MTWEOF error on %s. ERR=%s.\n"),
         dev->dev_name, strerror(dev->dev_errno));
+       }
    }
    return stat;
 }
index e4eaf9df49d51b9602847fabd8ed9ea899a49a39..78b96b7d25e9919cb7e1ccb9dce149c928c55853 100644 (file)
@@ -317,6 +317,7 @@ static int bootstrap_cmd(JCR *jcr)
    BSOCK *fd = jcr->file_bsock;
    POOLMEM *fname = get_pool_memory(PM_FNAME);
    FILE *bs;
+   int stat = 0;
 
    if (jcr->RestoreBootstrap) {
       unlink(jcr->RestoreBootstrap);
@@ -345,15 +346,18 @@ static int bootstrap_cmd(JCR *jcr)
    if (debug_level > 20) {
       dump_bsr(jcr->bsr, true);
    }
-   return bnet_fsend(fd, OK_bootstrap);
+   stat = 1;
 
 bail_out:
    unlink(jcr->RestoreBootstrap);
    free_pool_memory(jcr->RestoreBootstrap);
    jcr->RestoreBootstrap = NULL;
+   if (stat) {
+      return bnet_fsend(fd, OK_bootstrap);
+   } else {
    bnet_fsend(fd, ERROR_bootstrap);
    return 0;
-
+   }
 }
 
 
index 8673fa4757469bcffeff5669e5e0c23168e05dcc..57902162b0a57c39618fbc7214c9777ca530d2b4 100644 (file)
@@ -103,7 +103,7 @@ int job_cmd(JCR *jcr)
     */
    ojcr = get_jcr_by_full_name(job);
    if (ojcr && !ojcr->authenticated) {
-      Dmsg2(000, "Found ojcr=0x%x Job %s\n", (unsigned)ojcr, job);
+      Dmsg2(100, "Found ojcr=0x%x Job %s\n", (unsigned)ojcr, job);
       free_jcr(ojcr);
    }
    jcr->JobId = JobId;
index ece77a6bd24165fe62b2dfb1e32cca2006ce8439..45dcc15ccaef08e21a0ffd6985112e7f31da1f97 100755 (executable)
@@ -77,10 +77,16 @@ int match_bsr_block(BSR *bsr, DEV_BLOCK *block)
       return 1;                      /* cannot fast reject */
    }
 
-   if (match_block_sesstime(bsr, bsr->sesstime, block)) {
+   for ( ; bsr; bsr=bsr->next) {
+   if (!match_block_sesstime(bsr, bsr->sesstime, block)) {
+        continue;
+      }
+      if (!match_block_sessid(bsr, bsr->sessid, block)) {
+        continue;
+   }
       return 1;
    }
-   return match_block_sessid(bsr, bsr->sessid, block);
+   return 0;
 }
 
 static int match_block_sesstime(BSR *bsr, BSR_SESSTIME *sesstime, DEV_BLOCK *block)
@@ -135,7 +141,7 @@ int match_bsr(BSR *bsr, DEV_RECORD *rec, VOLUME_LABEL *volrec, SESSION_LABEL *se
       /* 
        * Note, bsr->reposition is set by match_all when
        *  a bsr is done. We turn it off if a match was
-       *  found or if we cannot use poistioning
+       *  found or if we cannot use positioning
        */
       if (stat != 0 || !bsr->use_positioning) {
         bsr->reposition = false;
@@ -157,10 +163,10 @@ BSR *find_next_bsr(BSR *root_bsr, DEVICE *dev)
 
    if (!root_bsr || !root_bsr->use_positioning || 
        !root_bsr->reposition || !dev_is_tape(dev)) {
-      Dmsg2(100, "use_pos=%d repos=%d\n", root_bsr->use_positioning,
-       root_bsr->reposition);
+      Dmsg2(100, "No nxt_bsr use_pos=%d repos=%d\n", root_bsr->use_positioning, root_bsr->reposition);
       return NULL;
    }
+   Dmsg2(100, "use_pos=%d repos=%d\n", root_bsr->use_positioning, root_bsr->reposition);
    root_bsr->mount_next_volume = false;
    for (bsr=root_bsr; bsr; bsr=bsr->next) {
       if (bsr->done || !match_volume(bsr, bsr->volume, &dev->VolHdr, 1)) {
@@ -231,6 +237,34 @@ static BSR *find_smallest_volfile(BSR *found_bsr, BSR *bsr)
    return return_bsr;
 }
 
+/* 
+ * Called to tell the matcher that the end of
+ *   the current file has been reached.
+ *  The bsr argument is not used, but is included
+ *    for consistency with the other match calls.
+ * 
+ * Returns: true if we should reposition
+ *       : false otherwise.
+ */
+bool match_set_eof(BSR *bsr, DEV_RECORD *rec)
+{
+   BSR *rbsr = rec->bsr;
+   Dmsg1(100, "match_set %d\n", rbsr != NULL);
+   if (!rbsr) {
+      return false;
+   }
+   rec->bsr = NULL;
+   rbsr->found++;
+   if (rbsr->count && rbsr->found >= rbsr->count) {
+      rbsr->done = true;
+      rbsr->root->reposition = true;
+      Dmsg2(100, "match_set_eof reposition count=%d found=%d\n",
+        rbsr->count, rbsr->found);
+      return true;
+   }
+   return false;
+}
+
 /* 
  * Match all the components of current record
  *   returns  1 on match
@@ -243,33 +277,54 @@ static int match_all(BSR *bsr, DEV_RECORD *rec, VOLUME_LABEL *volrec,
    if (bsr->done) {
       goto no_match;
    }
-   if (bsr->count && bsr->count <= bsr->found) {
-      bsr->done = true;
-      bsr->root->reposition = true;
-      Dmsg0(100, "bsr done from count\n");
-      goto no_match;
-   }
    if (!match_volume(bsr, bsr->volume, volrec, 1)) {
       goto no_match;
    }
    if (!match_volfile(bsr, bsr->volfile, rec, 1)) {
+      Dmsg2(100, "Fail on file. bsr=%d rec=%d\n", bsr->volfile->efile,
+        rec->File);
       goto no_match;
    }
    if (!match_sesstime(bsr, bsr->sesstime, rec, 1)) {
+      Dmsg2(100, "Fail on sesstime. bsr=%d rec=%d\n",
+        bsr->sesstime->sesstime, rec->VolSessionTime);
       goto no_match;
    }
 
    /* NOTE!! This test MUST come after the sesstime test */
    if (!match_sessid(bsr, bsr->sessid, rec)) {
+      Dmsg2(100, "Fail on sessid. bsr=%d rec=%d\n",
+        bsr->sessid->sessid, rec->VolSessionId);
       goto no_match;
    }
 
    /* NOTE!! This test MUST come after sesstime and sessid tests */
    if (!match_findex(bsr, bsr->FileIndex, rec, 1)) {
+      Dmsg2(100, "Fail on findex. bsr=%d rec=%d\n",
+        bsr->FileIndex->findex2, rec->FileIndex);
       goto no_match;
    }
+   /*
+    * If a count was specified and we have a FileIndex, assume
+    *  it is a Bacula created bsr (or the equivalent). We
+    *  then save the bsr where the match occurred so that
+    *  after processing the record or records, we can update
+    *  the found count. I.e. rec->bsr points to the bsr that
+    *  satisfied the match.
+    */
+   if (bsr->count && bsr->FileIndex) {
+      rec->bsr = bsr;
+      return 1;                      /* this is a complete match */
+   }
+
+   /*
+    * The selections below are not used by Bacula's
+    *   restore command, and don't work because of
+    *  the rec->bsr = bsr optimization above.
+    */
    if (!match_jobid(bsr, bsr->JobId, sessrec, 1)) {
       goto no_match;
+       
    }
    if (!match_job(bsr, bsr->job, sessrec, 1)) {
       goto no_match;
@@ -286,7 +341,6 @@ static int match_all(BSR *bsr, DEV_RECORD *rec, VOLUME_LABEL *volrec,
    if (!match_stream(bsr, bsr->stream, rec, 1)) {
       goto no_match;
    }
-   bsr->found++;
    return 1;
 
 no_match:
@@ -409,7 +463,8 @@ static int match_volfile(BSR *bsr, BSR_VOLFILE *volfile, DEV_RECORD *rec, bool d
    if (volfile->done && done) {
       bsr->done = true;
       bsr->root->reposition = true;
-      Dmsg0(100, "bsr done from volfile\n");
+      Dmsg2(100, "bsr done from volfile rec=%d volefile=%d\n", 
+        rec->File, volfile->efile);
    }
    return 0;
 }
@@ -464,6 +519,10 @@ static int match_sessid(BSR *bsr, BSR_SESSID *sessid, DEV_RECORD *rec)
    return 0;
 }
 
+/*
+ * When reading the Volume, the Volume Findex (rec->FileIndex) always
+ *   are found in sequential order. Thus we can make optimizations.
+ */
 static int match_findex(BSR *bsr, BSR_FINDEX *findex, DEV_RECORD *rec, bool done)
 {
    if (!findex) {
index 4d45f4e384c0466f9b9871766cf0e9acf1b8de12..c3ac6728af3cfbae5520564a33221395aef69021 100644 (file)
@@ -44,7 +44,6 @@
  * This routine returns a 0 only if it is REALLY
  *  impossible to get the requested Volume.
  *
- *    *****FIXME****** handle "Recycle" volume ******
  */
 int mount_next_write_volume(JCR *jcr, DEVICE *dev, DEV_BLOCK *block, int release)
 {
@@ -116,7 +115,7 @@ mount_next_vol:
 
       release = 1;                    /* release next time if we "recurse" */
 
-ask_again:
+// ask_again:
       if (ask && !dir_ask_sysop_to_mount_next_volume(jcr, dev)) {
          Dmsg0(100, "Error return ask_sysop ...\n");
         return 0;              /* error return */
@@ -227,7 +226,8 @@ mount_error:
          Jmsg1(jcr, M_WARNING, 0, "%s", jcr->errmsg);                         
          Dmsg0(100, "Default\n");
         ask = true;
-        goto ask_again;
+        /* was - goto ask_again; */         
+        goto mount_next_vol;
       }
       break;
    }
index 83343dcb7a19c5b1ed118572f2ab7c6c6f1863a5..7805c1c9d9685428e5f77bb8b7607b4fdc0d1372 100755 (executable)
@@ -713,9 +713,12 @@ void dump_bsr(BSR *bsr, bool recurse)
    }
    if (bsr->count) {
       Dmsg1(-1, "count       : %u\n", bsr->count);
+      Dmsg1(-1, "found       : %u\n", bsr->found);
    }
+
    Dmsg1(-1,    "done        : %s\n", bsr->done?"yes":"no");
    Dmsg1(-1,    "positioning : %d\n", bsr->use_positioning);
+   Dmsg1(-1,    "fast_reject : %d\n", bsr->use_fast_rejection);
    if (recurse && bsr->next) {
       Dmsg0(-1, "\n");
       dump_bsr(bsr->next, true);
index 8ad22626602f20375d793d796dd78c1868ef5d60..228cc20151eaddacd144504d9d27ece235888d01 100644 (file)
@@ -155,6 +155,7 @@ int match_bsr(BSR *bsr, DEV_RECORD *rec, VOLUME_LABEL *volrec,
 int match_bsr_block(BSR *bsr, DEV_BLOCK *block);
 void position_bsr_block(BSR *bsr, DEV_BLOCK *block);
 BSR *find_next_bsr(BSR *root_bsr, DEVICE *dev);
+bool match_set_eof(BSR *bsr, DEV_RECORD *rec);
 
 /* From mount.c */
 int     mount_next_write_volume(JCR *jcr, DEVICE *dev, DEV_BLOCK *block, int release);
index 8e34737869e67a9e9e3bfeae10f9426496876a92..705779ebd16d6b4121a2d4d6c1f23dbac09907e2 100644 (file)
 #include "bacula.h"
 #include "stored.h"
 
+/* Forward referenced functions */
 static void handle_session_record(DEVICE *dev, DEV_RECORD *rec, SESSION_LABEL *sessrec);
+static BSR *position_to_first_file(JCR *jcr, DEVICE *dev);
+static int try_repositioning(JCR *jcr, DEV_RECORD *rec, DEVICE *dev);
 #ifdef DEBUG
 static char *rec_state_to_str(DEV_RECORD *rec);
 #endif
@@ -52,6 +55,7 @@ int read_records(JCR *jcr,  DEVICE *dev,
 
    block = new_block(dev);
    recs = new dlist(rec, &rec->link);
+   position_to_first_file(jcr, dev);
 
    for ( ; ok && !done; ) {
       if (job_canceled(jcr)) {
@@ -59,18 +63,13 @@ int read_records(JCR *jcr,  DEVICE *dev,
         break;
       }
       if (!read_block_from_device(jcr, dev, block, CHECK_BLOCK_NUMBERS)) {
-         Dmsg0(20, "!read_record()\n");
         if (dev_state(dev, ST_EOT)) {
            DEV_RECORD *trec = new_record();
 
-            Dmsg3(100, "EOT. stat=%s blk=%d rem=%d\n", rec_state_to_str(rec), 
-                 block->BlockNumber, rec->remainder);
             Jmsg(jcr, M_INFO, 0, "End of Volume at file %u  on device %s, Volume \"%s\"\n", 
                 dev->file, dev_name(dev), jcr->VolumeName);
            if (!mount_cb(jcr, dev, block)) {
                Jmsg(jcr, M_INFO, 0, "End of all volumes.\n");
-               Dmsg3(100, "After mount next vol. stat=%s blk=%d rem=%d\n", rec_state_to_str(rec), 
-                 block->BlockNumber, rec->remainder);
               ok = FALSE;
               /*
                * Create EOT Label so that Media record may
@@ -79,13 +78,10 @@ int read_records(JCR *jcr,  DEVICE *dev,
                */
               trec->FileIndex = EOT_LABEL;
               trec->File = dev->file;
-              trec->Block = rec->Block; /* return block last read */
               ok = record_cb(jcr, dev, block, trec);
               free_record(trec);
               break;
            }
-            Dmsg3(100, "After mount next vol. stat=%s blk=%d rem=%d\n", rec_state_to_str(rec), 
-                 block->BlockNumber, rec->remainder);
            /*
             * We just have a new tape up, now read the label (first record)
             *  and pass it off to the callback routine, then continue
@@ -96,33 +92,17 @@ int read_records(JCR *jcr,  DEVICE *dev,
            handle_session_record(dev, trec, &sessrec);
            ok = record_cb(jcr, dev, block, trec);
            free_record(trec);
-           /*
-            * Now find and position to first file and block 
-            *   on this tape.
-            */
-           if (jcr->bsr) {
-              BSR *bsr;
-
-              jcr->bsr->reposition = true;
-              bsr = find_next_bsr(jcr->bsr, dev);
-              if (bsr) {
-                  Jmsg(jcr, M_INFO, 0, _("Forward spacing to file:block %u:%u.\n"), 
-                    bsr->volfile->sfile, bsr->volblock->sblock);
-                  Dmsg4(100, "Reposition new from (file:block) %d:%d to %d:%d\n",
-                       dev->file, dev->block_num, bsr->volfile->sfile,
-                       bsr->volblock->sblock);
-                 reposition_dev(dev, bsr->volfile->sfile, bsr->volblock->sblock);
-                  Dmsg2(100, "Now at (file:block) %d:%d\n",
-                       dev->file, dev->block_num);
-              }
-           }
+           position_to_first_file(jcr, dev);
            /* After reading label, we must read first data block */
            continue;
 
         } else if (dev_state(dev, ST_EOF)) {
+           if (verbose) {
             Jmsg(jcr, M_INFO, 0, "Got EOF at file %u  on device %s, Volume \"%s\"\n", 
                  dev->file, dev_name(dev), jcr->VolumeName);
-            Dmsg0(20, "read_record got eof. try again\n");
+           }
+            Dmsg3(100, "Got EOF at file %u  on device %s, Volume \"%s\"\n", 
+                 dev->file, dev_name(dev), jcr->VolumeName);
            continue;
         } else if (dev_state(dev, ST_SHORT)) {
             Jmsg(jcr, M_ERROR, 0, "%s", dev->errmsg);
@@ -134,16 +114,17 @@ int read_records(JCR *jcr,  DEVICE *dev,
            break;
         }
       }
-      Dmsg5(100, "Read block: dev=%d blk=%d VI=%u VT=%u blen=%d\n", dev->block_num, block->BlockNumber, 
-        block->VolSessionId, block->VolSessionTime, block->block_len);
+      Dmsg2(100, "New block at position=(file:block) %d:%d\n", dev->file, dev->block_num);
+#define FAST_BLOCK_REJECTION
+#ifdef FAST_BLOCK_REJECTION
+      /* this does not stop when file/block are too big */
       if (!match_bsr_block(jcr->bsr, block)) {
-         Dmsg5(100, "reject Blk=%u blen=%u bVer=%d SessId=%u SessTim=%u\n",
-           block->BlockNumber, block->block_len, block->BlockVer,
-           block->VolSessionId, block->VolSessionTime);
-        continue;
+        if (try_repositioning(jcr, rec, dev)) {
+           break;                    /* get next volume */
+        }
+        continue;                    /* skip this record */
       }
-      Dmsg4(100, "Block: %d VI=%u VT=%u blen=%d\n", block->BlockNumber, 
-        block->VolSessionId, block->VolSessionTime, block->block_len);
+#endif
 
       /*
        * Get a new record for each Job as defined by
@@ -163,21 +144,25 @@ int read_records(JCR *jcr,  DEVICE *dev,
          Dmsg2(100, "New record for SI=%d ST=%d\n",
             block->VolSessionId, block->VolSessionTime);
       } else {
+#ifdef xxx
         if (rec->Block != 0 && (rec->Block+1) != block->BlockNumber) {
             Jmsg(jcr, M_ERROR, 0, _("Invalid block number. Expected %u, got %u\n"),
                 rec->Block+1, block->BlockNumber);
         }
+#endif 
       }
       Dmsg3(100, "After mount next vol. stat=%s blk=%d rem=%d\n", rec_state_to_str(rec), 
            block->BlockNumber, rec->remainder);
       record = 0;
+      rec->state = 0;
+      Dmsg1(100, "Block empty %d\n", is_block_empty(rec));
       for (rec->state=0; !is_block_empty(rec); ) {
         if (!read_record_from_block(block, rec)) {
-            Dmsg3(10, "!read-break. stat=%s blk=%d rem=%d\n", rec_state_to_str(rec), 
+            Dmsg3(100, "!read-break. state=%s blk=%d rem=%d\n", rec_state_to_str(rec), 
                  block->BlockNumber, rec->remainder);
            break;
         }
-         Dmsg5(100, "read-OK. stat=%s blk=%d rem=%d file:block=%d:%d\n", 
+         Dmsg5(100, "read-OK. state=%s blk=%d rem=%d file:block=%d:%d\n", 
                 rec_state_to_str(rec), block->BlockNumber, rec->remainder,
                 dev->file, dev->block_num);
         /*
@@ -190,10 +175,6 @@ int read_records(JCR *jcr,  DEVICE *dev,
          Dmsg6(100, "recno=%d state=%s blk=%d SI=%d ST=%d FI=%d\n", record,
            rec_state_to_str(rec), block->BlockNumber,
            rec->VolSessionId, rec->VolSessionTime, rec->FileIndex);
-         Dmsg4(30, "VolSId=%ld FI=%s Strm=%s Size=%ld\n", rec->VolSessionId,
-              FI_to_ascii(rec->FileIndex), 
-              stream_to_ascii(rec->Stream, rec->FileIndex), 
-              rec->data_len);
 
         if (rec->FileIndex == EOM_LABEL) { /* end of tape? */
             Dmsg0(40, "Get EOM LABEL\n");
@@ -220,43 +201,40 @@ int read_records(JCR *jcr,  DEVICE *dev,
            int stat = match_bsr(jcr->bsr, rec, &dev->VolHdr, &sessrec);
            if (stat == -1) { /* no more possible matches */
               done = true;   /* all items found, stop */
+               Dmsg2(100, "All done=(file:block) %d:%d\n", dev->file, dev->block_num);
               break;
            } else if (stat == 0) {  /* no match */
-              BSR *bsr;
-              bsr = find_next_bsr(jcr->bsr, dev);
-              if (bsr == NULL && jcr->bsr->mount_next_volume) {
-                  Dmsg0(100, "Would mount next volume here\n");
-                  Dmsg2(100, "Current postion (file:block) %d:%d\n",
-                    dev->file, dev->block_num);
-                 jcr->bsr->mount_next_volume = false;
-                 dev->state |= ST_EOT;
-                 rec->Block = 0;
+               Dmsg4(100, "Clear rem=%d FI=%d before set_eof pos %d:%d\n", 
+                 rec->remainder, rec->FileIndex, dev->file, dev->block_num);
+              rec->remainder = 0;
+              rec->state &= ~REC_PARTIAL_RECORD;
+              if (try_repositioning(jcr, rec, dev)) {
                  break;
               }     
-              if (bsr) {
-                  Dmsg4(100, "Reposition from (file:block) %d:%d to %d:%d\n",
-                    dev->file, dev->block_num, bsr->volfile->sfile,
-                    bsr->volblock->sblock);
-                 reposition_dev(dev, bsr->volfile->sfile, bsr->volblock->sblock);
-                 rec->Block = 0;
-                  Dmsg2(100, "Now at (file:block) %d:%d\n",
-                    dev->file, dev->block_num);
-              }
-               Dmsg5(100, "BSR no match rec=%d block=%d SessId=%d SessTime=%d FI=%d\n",
-                 record, block->BlockNumber, rec->VolSessionId, rec->VolSessionTime, 
-                 rec->FileIndex);
                continue;              /* we don't want record, read next one */
            }
         }
         if (is_partial_record(rec)) {
-            Dmsg6(10, "Partial, break. recno=%d state=%s blk=%d SI=%d ST=%d FI=%d\n", record,
+            Dmsg6(100, "Partial, break. recno=%d state=%s blk=%d SI=%d ST=%d FI=%d\n", record,
               rec_state_to_str(rec), block->BlockNumber,
               rec->VolSessionId, rec->VolSessionTime, rec->FileIndex);
            break;                    /* read second part of record */
         }
         ok = record_cb(jcr, dev, block, rec);
+        if (rec->Stream == STREAM_MD5_SIGNATURE || rec->Stream == STREAM_SHA1_SIGNATURE) {
+            Dmsg3(100, "Done FI=%d before set_eof pos %d:%d\n", rec->FileIndex,
+                 dev->file, dev->block_num);
+           if (match_set_eof(jcr->bsr, rec) && try_repositioning(jcr, rec, dev)) {
+               Dmsg2(100, "Break after match_set_eof pos %d:%d\n",
+                    dev->file, dev->block_num);
+              break;
+           }
+            Dmsg2(100, "After set_eof pos %d:%d\n", dev->file, dev->block_num);
+        }
       } /* end for loop over records */
+      Dmsg2(100, "After end records position=(file:block) %d:%d\n", dev->file, dev->block_num);
    } /* end for loop over blocks */
+// Dmsg2(100, "Position=(file:block) %d:%d\n", dev->file, dev->block_num);
 
    /* Walk down list and free all remaining allocated recs */
    for (rec=(DEV_RECORD *)recs->first(); rec; ) {
@@ -271,6 +249,63 @@ int read_records(JCR *jcr,  DEVICE *dev,
    return ok;
 }
 
+/*
+ * See if we can reposition.
+ *   Returns:  1 if at end of volume
+ *            0 otherwise
+ */
+static int try_repositioning(JCR *jcr, DEV_RECORD *rec, DEVICE *dev)
+{
+   BSR *bsr;
+   bsr = find_next_bsr(jcr->bsr, dev);
+   if (bsr == NULL && jcr->bsr->mount_next_volume) {
+      Dmsg0(100, "Would mount next volume here\n");
+      Dmsg2(100, "Current postion (file:block) %d:%d\n",
+        dev->file, dev->block_num);
+      jcr->bsr->mount_next_volume = false;
+      dev->state |= ST_EOT;
+      rec->Block = 0;
+      return 1;
+   }    
+   if (bsr) {
+      if (verbose > 1) {
+         Jmsg(jcr, M_INFO, 0, "Reposition from (file:block) %d:%d to %d:%d\n",
+           dev->file, dev->block_num, bsr->volfile->sfile,
+           bsr->volblock->sblock);
+      }
+      Dmsg4(100, "Try_Reposition from (file:block) %d:%d to %d:%d\n",
+           dev->file, dev->block_num, bsr->volfile->sfile,
+           bsr->volblock->sblock);
+      reposition_dev(dev, bsr->volfile->sfile, bsr->volblock->sblock);
+      rec->Block = 0;
+   }
+   return 0;
+}
+
+/*
+ * Position to the first file on this volume
+ */
+static BSR *position_to_first_file(JCR *jcr, DEVICE *dev)
+{
+   BSR *bsr = NULL;
+   /*
+    * Now find and position to first file and block 
+    *  on this tape.
+    */
+   if (jcr->bsr) {
+      jcr->bsr->reposition = true;    /* force repositioning */
+      bsr = find_next_bsr(jcr->bsr, dev);
+      if (bsr && (bsr->volfile->sfile != 0 || bsr->volblock->sblock != 0)) {
+         Jmsg(jcr, M_INFO, 0, _("Forward spacing to file:block %u:%u.\n"), 
+           bsr->volfile->sfile, bsr->volblock->sblock);
+         Dmsg2(100, "Forward spacing to file:block %u:%u.\n", 
+           bsr->volfile->sfile, bsr->volblock->sblock);
+        reposition_dev(dev, bsr->volfile->sfile, bsr->volblock->sblock);
+      }
+   }
+   return bsr;
+}
+
 
 static void handle_session_record(DEVICE *dev, DEV_RECORD *rec, SESSION_LABEL *sessrec)
 {
index f00207547e1d47500c600d40a5a7bdb33e56bd8a..dd3047d478af6b6e1bfa893ffd9a9cda292fc2e8 100644 (file)
@@ -77,6 +77,7 @@
  * 
  *  This is the memory structure for the record header.
  */
+struct BSR;                           /* satisfy forward reference */
 struct DEV_RECORD {
    dlink link;                        /* link for chaining in read_record.c */
    /* File and Block are always returned during reading
@@ -91,6 +92,7 @@ struct DEV_RECORD {
    uint32_t data_len;                 /* current record length */
    uint32_t remainder;                /* remaining bytes to read/write */
    uint32_t state;                    /* state bits */
+   BSR *bsr;                          /* pointer to bsr that matched */
    uint8_t  ser_buf[WRITE_RECHDR_LENGTH];   /* serialized record header goes here */
    POOLMEM *data;                     /* Record data. This MUST be a memory pool item */
 };           
index 51d178023c820ae5fc76984e36d7258bb8876023..236d3b7d8f27ff302fc029e22ea958e1b2dfaeb4 100755 (executable)
@@ -71,28 +71,28 @@ main (int argc, char *const *argv)
 
    while ((ch = getopt(argc, argv, "ad:e:i:?")) != -1) {
       switch (ch) {
-         case 'a':                    /* print extended attributes *debug* */
-           attrs = 1;
-           break;
-
-         case 'd':                    /* set debug level */
-           debug_level = atoi(optarg);
-           if (debug_level <= 0) {
-              debug_level = 1; 
-           }
-           break;
+      case 'a':                       /* print extended attributes *debug* */
+        attrs = 1;
+        break;
+
+      case 'd':                       /* set debug level */
+        debug_level = atoi(optarg);
+        if (debug_level <= 0) {
+           debug_level = 1; 
+        }
+        break;
 
-         case 'e':                    /* exclude patterns */
-           exc = optarg;
-           break;
+      case 'e':                       /* exclude patterns */
+        exc = optarg;
+        break;
 
-         case 'i':                    /* include patterns */
-           inc = optarg;
-           break;
+      case 'i':                       /* include patterns */
+        inc = optarg;
+        break;
 
-         case '?':
-        default:
-           usage();
+      case '?':
+      default:
+        usage();
 
       }  
    }
@@ -200,6 +200,10 @@ static void print_ls_output(char *fname, char *link, int type, struct stat *stat
    char *p, *f;
    int n;
 
+   if (type == FT_LNK) {
+      statp->st_mtime = 0;
+      statp->st_mode |= 0777;
+   }
    p = encode_mode(statp->st_mode, buf);
    n = sprintf(p, " %2d ", (uint32_t)statp->st_nlink);
    p += n;
@@ -213,11 +217,7 @@ static void print_ls_output(char *fname, char *link, int type, struct stat *stat
       n = sprintf(p, "     ");
    }
    p += n;
-   if (type != FT_LNK) {
-      p = encode_time(statp->st_mtime, p);
-   } else {
-      p = encode_time(0, p);
-   }
+   p = encode_time(statp->st_mtime, p);
    *p++ = ' ';
    /* Copy file name */
    for (f=fname; *f && (p-buf) < (int)sizeof(buf); )
index 48e6090daa0ba0edef3537f228bcd574b98019f2..9a35e2d15a915df91bd30722237a00370dff0611 100644 (file)
@@ -1,9 +1,9 @@
 /* */
 #undef  VERSION
-#define VERSION "1.32"
+#define VERSION "1.32b"
 #define VSTRING "1"
-#define BDATE   "30 Sep 2003"
-#define LSMDATE "30Sep03"
+#define BDATE   "14 Oct 2003"
+#define LSMDATE "14Oct03"
 
 /* Debug flags */
 #undef  DEBUG
diff --git a/regress/.cvsignore b/regress/.cvsignore
deleted file mode 100644 (file)
index 120006c..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-build
-bin
-test.out
-weird-files
-diff
-tmp
-working
diff --git a/regress/README b/regress/README
deleted file mode 100644 (file)
index ad5056c..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-     Bacula Regression
-     Kern Sibbald
-     April 2003
-
-This is Bacula's regression script directory.  At this time
-(May 2003), it is still in development, so all the tests are
-not complete.
-
-To set it up, first edit Makefile and set BACULA-SOURCE to point
-to your source.
-
-!!!!!!!!!! IMPORTANT !!!!!!!!
-Second, edit the EMAIL address in the Makefile to be your
-email address and not mine or I will get LOTS of unwanted
-email!
-
-Third, edit the DEPKGS path in the Makefile to point to the
-depkgs directory.
-
-Fourth, make sure that depkgs is pre-built if it isn't 
-already: (cd your-depkgs; make sqlite).
-
-Then do:
-
-   make setup
-
-You run the above one time.  This will copy the Bacula
-source, configure, build it, and configure all the scripts
-and conf files.  If you change your source, you will need
-to redo this command. 
-
-Then you can run any of the tests in the tests subdirectory.
-Each test whose name ends in -root requires you to be root for
-a resonable run.  Each test is totally independent of any other
-test. Aside from the required "make setup", each test is totally
-self-initalizing and should clean up after itself.
-
-Not all the tests yet report OK.  This is simply because there are
-some spurious differences that I haven't yet taken the time to
-eliminate.  The working scrips as of 24 Apr 03 are:
-
-backup-bacula-test
-sparse-test
-compressed-test
-sparse-compressed-test
-two-jobs-test
-wierd-files-test
-verify-vol-test
-
-The tests expect you to execute them from the main regress 
-directory!               
-
-You can run them individually as:
-
-   tests/two-jobs-test
-
-or all non-root tests (my normal testing under my account)
-
-  ./all-non-root-tests
-
-or all tests (I only run these before a production release):
-
-   su
-   ./all-tests
-
-
-after running the root tests, while still root, it is a good idea
-to do:
-
-   make reset
-
-this cleans up any files that may be created with root permissions.
-
-If you want to add more tests, do so by putting the shell script 
-in the tests subdirectory. Be careful when adding (or better not)
-new clients, pools, and such to the test-bacula-dir.conf.in file
-as it may invalidate a good number of tests, which respond to
-questions by answering with a number (i.e. the order of the selection
-list is known). It might be better to add your own testb-bacula...
-configuration file.  
-
-To avoid re-doing a make setup if you have made a change to the
-conf files, and you do not need a new copy of the source, you can simply do:
-
-   scripts/do-sed <your-email-address>
diff --git a/regress/all-non-root-tape-tests b/regress/all-non-root-tape-tests
deleted file mode 100755 (executable)
index 13fffb0..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/sh
-#
-# Run all tape tests
-#
-tests/test0
-tests/backup-bacula-tape
-tests/small-file-size-tape
-tests/two-volume-tape
-echo " "
-echo " "
-echo "Test results"
-cat test.out
-scripts/cleanup
diff --git a/regress/all-non-root-tests b/regress/all-non-root-tests
deleted file mode 100755 (executable)
index 2b2c48d..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/sh
-#
-# Run all tests
-#
-tests/test0
-tests/backup-bacula-test
-tests/verify-vol-test
-tests/sparse-test
-tests/compressed-test
-tests/sparse-compressed-test
-tests/weird-files-test
-tests/two-jobs-test
-tests/two-vol-test
-tests/six-vol-test
-tests/bscan-test
-tests/weird-files2-test
-tests/concurrent-jobs-test
-tests/four-concurrent-jobs-test
-tests/bsr-opt-test
-tests/bextract-test
-tests/recycle-test
-tests/span-vol-test
-tests/restore-by-file-test
-echo " "
-echo " "
-echo "Test results"
-cat test.out
-scripts/cleanup
diff --git a/regress/all-root-tests b/regress/all-root-tests
deleted file mode 100755 (executable)
index 9eb8995..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-#
-# Run all root tests
-#
-tests/dev-test-root
-tests/etc-test-root
-tests/lib-test-root
-cat test.out
-scripts/cleanup
diff --git a/regress/all-tape-and-file-tests b/regress/all-tape-and-file-tests
deleted file mode 100755 (executable)
index 8579344..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/sh
-#
-# Run all tests
-#
-tests/test0
-tests/backup-bacula-test
-tests/verify-vol-test
-tests/sparse-test
-tests/compressed-test
-tests/sparse-compressed-test
-tests/weird-files-test
-tests/two-jobs-test
-tests/two-vol-test
-tests/six-vol-test
-tests/bscan-test
-tests/weird-files2-test
-tests/concurrent-jobs-test
-tests/four-concurrent-jobs-test
-tests/bsr-opt-test
-tests/bextract-test
-tests/recycle-test
-tests/span-vol-test
-tests/backup-bacula-tape
-tests/small-file-size-tape
-tests/two-volume-tape
-echo " "
-echo " "
-echo "Test results"
-cat test.out
-scripts/cleanup
diff --git a/regress/all-tests b/regress/all-tests
deleted file mode 100755 (executable)
index b1b2b35..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-#
-# Run all tests
-#
-./all-non-root-tests
-./all-root-tests
-cat test.out
-scripts/cleanup
diff --git a/regress/scripts/.cvsignore b/regress/scripts/.cvsignore
deleted file mode 100644 (file)
index 0253541..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-bacula-dir.conf
-bacula-fd.conf
-bacula-sd.conf
-console.conf
-test-bacula-dir.conf
-test-bacula-fd.conf
-test-bacula-sd.conf
-test-console.conf
-testa-bacula-dir.conf
-bacula-dir-tape.conf
-bacula-sd-tape.conf
-cleanup-tape
diff --git a/regress/scripts/bacula-dir-tape.conf.in b/regress/scripts/bacula-dir-tape.conf.in
deleted file mode 100644 (file)
index da9ac34..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-#
-# Default Bacula Director Configuration file
-#
-#  The only thing that MUST be changed is to add one or more
-#   file or directory names in the Include directive of the
-#   FileSet resource.
-#
-#  For Bacula release 1.30 (12 April 2003) -- redhat 7.3
-#
-#  You might also want to change the default email address
-#   from root to your address.  See the "mail" and "operator"
-#   directives in the Messages resource.
-#
-
-Director {                            # define myself
-  Name = @hostname@-dir
-  DIRport = 8101                # where we listen for UA connections
-  QueryFile = "@scriptdir@/query.sql"
-  WorkingDirectory = "@working_dir@"
-  PidDirectory = "@piddir@"
-  Maximum Concurrent Jobs = 4
-  Password = "pNvX1WiXnwv2C/F7E52LGvw6rKjbbPvu2kyuPa9pVaL3"
-  Messages = Standard
-}
-
-#
-# Define the main nightly save backup job
-#   By default, this job will back up to disk in /tmp
-Job {
-  Name = "NightlySave"
-  Type = Backup
-  Client=@hostname@-fd 
-  FileSet="Full Set"
-  Storage = DDS-4
-  Messages = Standard
-  Pool = Default
-  Write Bootstrap = "@working_dir@/NightlySave.bsr"
-  Maximum Concurrent Jobs = 4
-}
-
-
-# Standard Restore template, to be changed by Console program
-Job {
-  Name = "RestoreFiles"
-  Type = Restore
-  Client=@hostname@-fd 
-  FileSet="Full Set"
-  Storage = DDS-4
-  Messages = Standard
-  Pool = Default
-  Where = /tmp/bacula-restores
-}
-
-
-# List of files to be backed up
-FileSet {
-  Name = "Full Set"
-  Include = signature=MD5 { 
-    </tmp/file-list
-  }
-}
-
-
-#
-# When to do the backups, full backup on first sunday of the month,
-#  differential (i.e. incremental since full) every other sunday,
-#  and incremental backups other days
-Schedule {
-  Name = "WeeklyCycle"
-  Run = Full 1st sun at 1:05
-  Run = Differential 2nd-5th sun at 1:05
-  Run = Incremental mon-sat at 1:05
-}
-
-# Client (File Services) to backup
-Client {
-  Name = @hostname@-fd
-  Address = @hostname@
-  FDPort = 8102
-  Catalog = MyCatalog
-  Password = "xevrjURYoCHhn26RaJoWbeWXEY/a3VqGKp/37tgWiuHc"          # password for FileDaemon
-  File Retention = 30d                # 30 days
-  Job Retention = 180d                # six months
-  AutoPrune = yes                     # Prune expired Jobs/Files
-  Maximum Concurrent Jobs = 4
-}
-
-# Definition of DDS tape storage device
-Storage {
-  Name = DDS-4
-  Address = @hostname@                # N.B. Use a fully qualified name here
-  SDPort = 8103
-  Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"          # password for Storage daemon
-  Device = DDS-4                      # must be same as Device in Storage daemon
-  Media Type = DDS-4                  # must be same as MediaType in Storage daemon
-  AutoChanger = yes
-}
-
-
-# Generic catalog service
-Catalog {
-  Name = MyCatalog
-  dbname = bacula; user = bacula; password = ""
-}
-
-# Reasonable message delivery -- send most everything to email address
-#  and to the console
-Messages {
-  Name = Standard
-  mailcommand = "@sbindir@/smtp -h localhost -f \"\(Bacula Regression\) %r\" -s \"Bacula: %t %e of %c %l\" %r"
-  operatorcommand = "@sbindir@/smtp -h localhost -f \"\(Bacula Regression\) %r\" -s \"Bacula: Intervention needed for %j\" %r"
-  MailOnError = @job_email@ = all
-  operator = @job_email@ = mount
-  console = all, !skipped
-#
-# WARNING! the following will create a file that you must cycle from
-#          time to time as it will grow indefinitely. However, it will
-#          also keep all your messages if the scroll off the console.
-#
-  append = "@working_dir@/log" = all, !skipped
-}
-
-    
-# Default pool definition
-Pool {
-  Name = Default
-  Pool Type = Backup
-  Recycle = yes                       # Bacula can automatically recycle Volumes
-  AutoPrune = yes                     # Prune expired volumes
-  Volume Retention = 365d             # one year
-  Accept Any Volume = yes             # write on any volume in the pool
-}
diff --git a/regress/scripts/bacula-sd-tape.conf.in b/regress/scripts/bacula-sd-tape.conf.in
deleted file mode 100644 (file)
index f78dcb6..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# Default Bacula Storage Daemon Configuration file
-#
-#  For Bacula release 1.30 (12 April 2003) -- redhat 7.3
-#
-# You may need to change the name of your tape drive
-#   on the "Archive Device" directive in the Device
-#   resource.  If you change the Name and/or the 
-#   "Media Type" in the Device resource, please ensure
-#   that dird.conf has corresponding changes.
-#
-
-Storage {                             # definition of myself
-  Name = @hostname@-sd
-  SDPort = 8103                  # Director's port      
-  WorkingDirectory = "@working_dir@"
-  Pid Directory = "@piddir@"
-  Subsys Directory = "@subsysdir@"
-}
-
-#
-# List Directors who are permitted to contact Storage daemon
-#
-Director {
-  Name = @hostname@-dir
-  Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"
-}
-
-#
-# Devices supported by this Storage daemon
-# To connect, the Director's bacula-dir.conf must have the
-#  same Name and MediaType. 
-#
-
-Device {
-  Name = DDS-4                     # 
-  Media Type = DDS-4
-  Changer Device = @autochanger@
-  Changer Command ="@scriptdir@/mtx-changer %c %o %S %a"
-  Archive Device = @tape_drive@
-  AutomaticMount = yes;               # when device opened, read it
-  AlwaysOpen = yes;
-  RemovableMedia = yes;
-# Maximum File Size = 1000000
-}
-
-# 
-# Send all messages to the Director, 
-# mount messages also are sent to the email address
-#
-Messages {
-  Name = Standard
-  director = @hostname@-dir = all
-}
diff --git a/regress/scripts/bacula-sd.conf.in b/regress/scripts/bacula-sd.conf.in
deleted file mode 100644 (file)
index 47422aa..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-#
-# Default Bacula Storage Daemon Configuration file
-#
-#  For Bacula release 1.32 (20 Sep 2003) -- redhat 9
-#
-# You may need to change the name of your tape drive
-#   on the "Archive Device" directive in the Device
-#   resource.  If you change the Name and/or the 
-#   "Media Type" in the Device resource, please ensure
-#   that dird.conf has corresponding changes.
-#
-
-Storage {                             # definition of myself
-  Name = rufus-sd
-  SDPort = 8103                  # Director's port      
-  WorkingDirectory = "/home/kern/bacula/regress/working"
-  Pid Directory = "/home/kern/bacula/regress/working"
-}
-
-#
-# List Directors who are permitted to contact Storage daemon
-#
-Director {
-  Name = rufus-dir
-  Password = "BzlEl8haeFmnv/Lv8V6zDzUBgFFQNsUtny6VkmccQpOy"
-}
-
-#
-# Devices supported by this Storage daemon
-# To connect, the Director's bacula-dir.conf must have the
-#  same Name and MediaType. 
-#
-
-Device {
-  Name = FileStorage
-  Media Type = File
-  Archive Device = @tmpdir@
-  LabelMedia = yes;                   # lets Bacula label unlabeled media
-  Random Access = Yes;
-  AutomaticMount = yes;               # when device opened, read it
-  RemovableMedia = no;
-  AlwaysOpen = no;
-}
-
-#Device {
-#  Name = DDS-4                        # 
-#  Media Type = DDS-4
-#  Archive Device = /dev/nst0
-#  AutomaticMount = yes;               # when device opened, read it
-#  AlwaysOpen = yes;
-#  RemovableMedia = yes;
-#}
-
-#
-# A very old Exabyte with no end of media detection
-#
-#Device {
-#  Name = "Exabyte 8mm"
-#  Media Type = "8mm"
-#  Archive Device = /dev/nst0
-#  Hardware end of medium = No;
-#  AutomaticMount = yes;               # when device opened, read it
-#  AlwaysOpen = Yes;
-#  RemovableMedia = yes;
-#}
-
-# 
-# Send all messages to the Director, 
-# mount messages also are sent to the email address
-#
-Messages {
-  Name = Standard
-  director = rufus-dir = all
-}
diff --git a/regress/scripts/cleanup b/regress/scripts/cleanup
deleted file mode 100755 (executable)
index 8bd8365..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-#
-# Cleanup left over files -- both before and after test run
-#
-rm -rf /tmp/TestVolume001 /tmp/bacula-restores /tmp/Small*
-rm -rf tmp/original tmp/bacula-restores tmp/Small* tmp/TestVolume*
-rm -rf tmp/restored tmp/largefile tmp/bscan.bsr tmp/log*.out
-rm -rf /tmp/sed_tmp /tmp/file-list
-rm -rf tmp/build tmp/restore-list
diff --git a/regress/scripts/cleanup-tape.in b/regress/scripts/cleanup-tape.in
deleted file mode 100755 (executable)
index 64ad92f..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/sh
-#
-# Cleanup left over files -- both before and after test run
-#
-rm -rf /tmp/TestVolume001 /tmp/bacula-restores /tmp/Small*
-rm -rf tmp/original tmp/bacula-restores tmp/Small* tmp/TestVolume*
-rm -rf tmp/restored tmp/largefile tmp/bscan.bsr tmp/log*.out
-
-#
-# If we have an autochanger always load tape in slot 1
-#
-if ! test x@autochanger@ = x/dev/null; then
-   drive=`bin/mtx-changer @autochanger@ loaded`
-   if ! test x$drive = x1; then
-      bin/mtx-changer @autochanger@ unload
-      bin/mtx-changer @autochanger@ load 1
-   fi
-fi
-
-mt -f @tape_drive@ rewind
-mt -f @tape_drive@ weof
diff --git a/regress/scripts/copy-confs b/regress/scripts/copy-confs
deleted file mode 100755 (executable)
index ee77a34..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-/bin/cp -f scripts/bacula-dir.conf bin/bacula-dir.conf
-/bin/cp -f scripts/bacula-sd.conf bin/bacula-sd.conf
-/bin/cp -f scripts/bacula-fd.conf bin/bacula-fd.conf
-/bin/cp -f scripts/console.conf bin/console.conf
diff --git a/regress/scripts/copy-tape-confs b/regress/scripts/copy-tape-confs
deleted file mode 100755 (executable)
index 28223b0..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-/bin/cp -f scripts/bacula-dir-tape.conf bin/bacula-dir.conf
-/bin/cp -f scripts/bacula-sd-tape.conf bin/bacula-sd.conf
-/bin/cp -f scripts/test-bacula-fd.conf bin/bacula-fd.conf
-/bin/cp -f scripts/test-console.conf bin/console.conf
diff --git a/regress/scripts/copy-test-confs b/regress/scripts/copy-test-confs
deleted file mode 100755 (executable)
index 45a30a2..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-/bin/cp -f scripts/test-bacula-dir.conf bin/bacula-dir.conf
-/bin/cp -f scripts/test-bacula-sd.conf bin/bacula-sd.conf
-/bin/cp -f scripts/test-bacula-fd.conf bin/bacula-fd.conf
-/bin/cp -f scripts/test-console.conf bin/console.conf
diff --git a/regress/scripts/copy-testa-confs b/regress/scripts/copy-testa-confs
deleted file mode 100755 (executable)
index 0574b9a..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-/bin/cp -f scripts/testa-bacula-dir.conf bin/bacula-dir.conf
-/bin/cp -f scripts/test-bacula-sd.conf bin/bacula-sd.conf
-/bin/cp -f scripts/test-bacula-fd.conf bin/bacula-fd.conf
-/bin/cp -f scripts/test-console.conf bin/console.conf
diff --git a/regress/scripts/do_sed b/regress/scripts/do_sed
deleted file mode 100755 (executable)
index 165a204..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/sh
-#
-if test $# != 3 ; then
-   echo "First arg must be email name"
-   echo "  and the second must be a tape drive"
-   echo "  and the third must be a tape control name or /dev/null"
-   exit 1
-fi
-out="/tmp/sed_tmp"
-cwd=`pwd`
-host=`hostname | tr '.' ' ' | cut -f 1 -d ' '`
-if test x$host = x ; then
-   host=localhost 
-fi
-# Create sed command script
-echo "s%@sbindir@%${cwd}/bin%g" >${out}
-echo "s%@scriptdir@%${cwd}/bin%g" >>${out}
-echo "s%@working_dir@%${cwd}/working%g" >>${out}
-echo "s%@piddir@%${cwd}/working%g" >>${out}
-echo "s%@subsysdir@%${cwd}/working%g" >>${out}
-echo "s%@job_email@%${1}%g" >>${out}
-echo "s%@tape_drive@%${2}%g" >>${out}
-echo "s%@autochanger@%${3}%g" >>${out}
-echo "s%@tmpdir@%${cwd}/tmp%g" >>${out}
-echo "s%@hostname@%${host}%g" >>${out}
-
-# process .in files with sed script
-sed -f ${out} ${cwd}/scripts/test-bacula-dir.conf.in >${cwd}/scripts/test-bacula-dir.conf
-sed -f ${out} ${cwd}/scripts/testa-bacula-dir.conf.in >${cwd}/scripts/testa-bacula-dir.conf
-sed -f ${out} ${cwd}/scripts/test-bacula-fd.conf.in >${cwd}/scripts/test-bacula-fd.conf
-sed -f ${out} ${cwd}/scripts/test-bacula-sd.conf.in >${cwd}/scripts/test-bacula-sd.conf
-sed -f ${out} ${cwd}/scripts/test-console.conf.in >${cwd}/scripts/test-console.conf
-sed -f ${out} ${cwd}/scripts/bacula-dir-tape.conf.in >${cwd}/scripts/bacula-dir-tape.conf
-sed -f ${out} ${cwd}/scripts/bacula-sd-tape.conf.in >${cwd}/scripts/bacula-sd-tape.conf
-sed -f ${out} ${cwd}/scripts/cleanup-tape.in >${cwd}/scripts/cleanup-tape
-cp ${cwd}/bin/bacula-sd.conf /tmp/bac$$
-sed s%/tmp%${cwd}/tmp%g /tmp/bac$$ >${cwd}/bin/bacula-sd.conf
-chmod 777 ${cwd}/scripts/cleanup-tape
-
-rm -f ${out}
-rm -f /tmp/bac$$
diff --git a/regress/scripts/exclude-dev-test b/regress/scripts/exclude-dev-test
deleted file mode 100644 (file)
index 4165ea1..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-dev/ptmx
-dev/pts
-dev/rd/c5d2
-dev/rd
-dev/shm
diff --git a/regress/scripts/exclude-etc-test b/regress/scripts/exclude-etc-test
deleted file mode 100644 (file)
index f59ca8d..0000000
+++ /dev/null
@@ -1 +0,0 @@
-etc/mail/statistics
diff --git a/regress/scripts/exclude-lib-test b/regress/scripts/exclude-lib-test
deleted file mode 100644 (file)
index 5be32f4..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-lib/ld-2.2.5.so
-lib/libtermcap.so.2.0.8
-lib/libc-2.2.5.so
-lib/libnsl-2.2.5.so
-lib/libnss_files-2.2.5.so
diff --git a/regress/scripts/regress-config b/regress/scripts/regress-config
deleted file mode 100755 (executable)
index e03e84b..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-#
-# This is the configuration script for regression testing
-#
-
-CFLAGS="-g -O2 -Wall" \
- ./configure \
-    --sbindir=$1/bin \
-    --sysconfdir=$1/bin \
-    --with-pid-dir=$1/working \
-    --with-subsys-dir=$1/working \
-    --enable-smartalloc \
-    --disable-readline \
-    --with-sqlite=$2 \
-    --with-working-dir=$1/working \
-    --with-dump-email=$3 \
-    --with-job-email=$3 \
-    --with-baseport=8101 
-
-exit 0
diff --git a/regress/scripts/setup b/regress/scripts/setup
deleted file mode 100755 (executable)
index 48d7123..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/bin/sh
-#
-# Script to setup running Bacula regression tests
-#
-cwd=`pwd`
-if [ $# != 3 ] ; then
-   echo "Incorrect number of arguments. Need:"
-   echo "setup bacula-src depkgs email-address"
-   echo " "
-   exit 1
-fi
-if [ ! -d $1 ] ; then
-   echo "Arg 1 must be a Bacula release directory."
-   echo " "
-   exit 1
-fi
-if [ ! -d $2 ] ; then
-   cd ..
-   cwd=`pwd`
-   echo "The regression scripts require DEPKGS as arg 2 but not found!" 
-   echo " "
-   exit 1
-fi
-rm -rf build bin
-# Copy new source
-cp -rp $1 build
-cp scripts/regress-config build
-cd build
-rm -f Makefile config.cache
-# Run Bacula configuration, make, install
-./regress-config ${cwd} $2 $3
-make
-make install
-cp src/tools/testls ../bin
-
-cd ..
-bin/bacula stop
-bin/create_sqlite_database
-bin/drop_sqlite_tables
-bin/make_sqlite_tables
-# Start and stop Bacula to ensure conf files are OK
-bin/bacula start
-bin/bacula stop
-#
-# Save Bacula default conf files for later use
-#
-cp -f bin/*.conf scripts
diff --git a/regress/scripts/test-bacula-dir.conf.in b/regress/scripts/test-bacula-dir.conf.in
deleted file mode 100644 (file)
index e584b9f..0000000
+++ /dev/null
@@ -1,298 +0,0 @@
-#
-# Default Bacula Director Configuration file
-#
-#  The only thing that MUST be changed is to add one or more
-#   file or directory names in the Include directive of the
-#   FileSet resource.
-#
-#  For Bacula release 1.30 (12 April 2003) -- redhat 7.3
-#
-#  You might also want to change the default email address
-#   from root to your address.  See the "mail" and "operator"
-#   directives in the Messages resource.
-#
-
-Director {                            # define myself
-  Name = @hostname@-dir
-  DIRport = 8101                # where we listen for UA connections
-  QueryFile = "@scriptdir@/query.sql"
-  WorkingDirectory = "@working_dir@"
-  PidDirectory = "@piddir@"
-  SubSysDirectory = "@subsysdir@"
-  Maximum Concurrent Jobs = 4
-  Password = "pNvX1WiXnwv2C/F7E52LGvw6rKjbbPvu2kyuPa9pVaL3"         # Console password
-  Messages = Standard
-}
-
-#
-# Define the main nightly save backup job
-#   By default, this job will back up to disk in /tmp
-Job {
-  Name = "NightlySave"
-  Type = Backup
-  Client=@hostname@-fd 
-  FileSet="Full Set"
-  Storage = File
-  Messages = Standard
-  Pool = Default
-  Write Bootstrap = "@working_dir@/NightlySave.bsr"
-  Maximum Concurrent Jobs = 4
-}
-
-Job {
-  Name = "MonsterSave"
-  Type = Backup
-  Client=@hostname@-fd 
-  FileSet="Full Set"
-  Storage = File1
-  Messages = Standard
-  Pool = Default
-  Write Bootstrap = "@working_dir@/NightlySave.bsr"
-}
-
-
-Job {
-  Name = "VerifyVolume"
-  Type = Verify
-  Level = VolumeToCatalog
-  Client=@hostname@-fd 
-  FileSet="Full Set"
-  Storage = File
-  Messages = Standard
-  Pool = Default
-  Write Bootstrap = "@working_dir@/NightlySave.bsr"
-}
-
-
-Job {
-  Name = "SparseTest"
-  Type = Backup
-  Client=@hostname@-fd 
-  FileSet="SparseSet"
-  Storage = File
-  Messages = Standard
-  Pool = Default
-  Write Bootstrap = "@working_dir@/NightlySave.bsr"
-}
-
-Job {
-  Name = "CompressedTest"
-  Type = Backup
-  Client=@hostname@-fd 
-  FileSet="CompressedSet"
-  Storage = File
-  Messages = Standard
-  Pool = Default
-  Maximum Concurrent Jobs = 4
-  Write Bootstrap = "@working_dir@/NightlySave.bsr"
-}
-
-Job {
-  Name = "SparseCompressedTest"
-  Type = Backup
-  Client=@hostname@-fd 
-  FileSet="SparseCompressedSet"
-  Storage = File
-  Messages = Standard
-  Pool = Default
-  Write Bootstrap = "@working_dir@/NightlySave.bsr"
-}
-
-
-# Backup the catalog database (after the nightly save)
-Job {
-  Name = "BackupCatalog"
-  Type = Backup
-  Client=@hostname@-fd 
-  FileSet="Catalog"
-#  Schedule = "WeeklyCycleAfterBackup"
-  Storage = File
-  Messages = Standard
-  Pool = Default
-  # This creates an ASCII copy of the catalog
-  RunBeforeJob = "@sbindir@/make_catalog_backup -u bacula"
-  # This deletes the copy of the catalog
-  RunAfterJob  = "@sbindir@/delete_catalog_backup"
-  Write Bootstrap = "@working_dir@/BackupCatalog.bsr"
-}
-
-# Standard Restore template, to be changed by Console program
-Job {
-  Name = "RestoreFiles"
-  Type = Restore
-  Client=@hostname@-fd 
-  FileSet="Full Set"
-  Storage = File
-  Messages = Standard
-  Pool = Default
-  Where = /tmp/bacula-restores
-}
-
-
-# List of files to be backed up
-FileSet {
-  Name = "Full Set"
-  Include = signature=MD5 { 
-    </tmp/file-list
-  }
-}
-
-FileSet {
-  Name = "SparseSet"
-  Include = signature=MD5 sparse=yes { 
-    </tmp/file-list
-  }
-}
-
-FileSet {
-  Name = "CompressedSet"
-  Include = signature=MD5 compression=GZIP { 
-    </tmp/file-list
-  }
-}
-
-FileSet {
-  Name = "SparseCompressedSet"
-  Include = signature=MD5 compression=GZIP { 
-    </tmp/file-list
-  }
-}
-
-
-
-#
-# When to do the backups, full backup on first sunday of the month,
-#  differential (i.e. incremental since full) every other sunday,
-#  and incremental backups other days
-Schedule {
-  Name = "WeeklyCycle"
-  Run = Full 1st sun at 1:05
-  Run = Differential 2nd-5th sun at 1:05
-  Run = Incremental mon-sat at 1:05
-}
-
-# This schedule does the catalog. It starts after the WeeklyCycle
-Schedule {
-  Name = "WeeklyCycleAfterBackup"
-  Run = Full sun-sat at 1:10
-}
-
-# This is the backup of the catalog
-FileSet {
-  Name = "Catalog"
-  Include = signature=MD5 {
-     /home/kern/bacula/regress/bin/working/bacula.sql
-  }
-}
-
-# Client (File Services) to backup
-Client {
-  Name = @hostname@-fd
-  Address = @hostname@
-  FDPort = 8102
-  Catalog = MyCatalog
-  Password = "xevrjURYoCHhn26RaJoWbeWXEY/a3VqGKp/37tgWiuHc"          # password for FileDaemon
-  File Retention = 30d                # 30 days
-  Job Retention = 180d                # six months
-  AutoPrune = yes                     # Prune expired Jobs/Files
-  Maximum Concurrent Jobs = 4
-}
-
-# Definiton of file storage device
-Storage {
-  Name = File
-  Address = @hostname@                # N.B. Use a fully qualified name here
-  SDPort = 8103
-  Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"
-  Device = FileStorage
-  Media Type = File
-  Maximum Concurrent Jobs = 4
-}
-
-Storage {
-  Name = File1
-  Address = @hostname@                # N.B. Use a fully qualified name here
-  SDPort = 8103
-  Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"
-  Device = FileStorage1
-  Media Type = File1
-  Maximum Concurrent Jobs = 4
-}
-
-
-# Definition of DLT tape storage device
-#Storage {
-#  Name = DLTDrive
-#  Address = @hostname@                # N.B. Use a fully qualified name here
-#  SDPort = 8103
-#  Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"          # password for Storage daemon
-#  Device = "HP DLT 80"                # must be same as Device in Storage daemon
-#  Media Type = DLT8000                # must be same as MediaType in Storage daemon
-#}
-
-# Definition of DDS tape storage device
-#Storage {
-#  Name = SDT-10000
-#  Address = @hostname@                # N.B. Use a fully qualified name here
-#  SDPort = 8103
-#  Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"          # password for Storage daemon
-#  Device = SDT-10000                  # must be same as Device in Storage daemon
-#  Media Type = DDS-4                  # must be same as MediaType in Storage daemon
-#}
-
-# Definition of 8mm tape storage device
-#Storage {
-#  Name = "8mmDrive"
-#  Address = @hostname@                # N.B. Use a fully qualified name here
-#  SDPort = 8103
-#  Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"
-#  Device = "Exabyte 8mm"
-#  MediaType = "8mm"
-#}
-
-
-# Generic catalog service
-Catalog {
-  Name = MyCatalog
-  dbname = bacula; user = bacula; password = ""
-}
-
-# Reasonable message delivery -- send most everything to email address
-#  and to the console
-Messages {
-  Name = Standard
-  mailcommand = "@sbindir@/smtp -h localhost -f \"\(Bacula Regression\) %r\" -s \"Bacula: %t %e of %c %l\" %r"
-  operatorcommand = "@sbindir@/smtp -h localhost -f \"\(Bacula Regression\) %r\" -s \"Bacula: Intervention needed for %j\" %r"
-  MailOnError = @job_email@ = all
-  operator = @job_email@ = mount
-  console = all, !skipped
-#
-# WARNING! the following will create a file that you must cycle from
-#          time to time as it will grow indefinitely. However, it will
-#          also keep all your messages if the scroll off the console.
-#
-  append = "@working_dir@/log" = all, !skipped
-}
-
-Messages {
-  Name = NoEmail
-  mailcommand = "@sbindir@/smtp -h localhost -f \"\(Bacula Regression\) %r\" -s \"Bacula: %t %e of %c %l\" %r"
-  console = all, !skipped
-#
-# WARNING! the following will create a file that you must cycle from
-#          time to time as it will grow indefinitely. However, it will
-#          also keep all your messages if the scroll off the console.
-#
-  append = "@working_dir@/log" = all, !skipped
-}
-
-    
-# Default pool definition
-Pool {
-  Name = Default
-  Pool Type = Backup
-  Recycle = yes                       # Bacula can automatically recycle Volumes
-  AutoPrune = yes                     # Prune expired volumes
-  Volume Retention = 365d             # one year
-  Accept Any Volume = yes             # write on any volume in the pool
-}
diff --git a/regress/scripts/test-bacula-fd.conf.in b/regress/scripts/test-bacula-fd.conf.in
deleted file mode 100644 (file)
index c5554bb..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# Default  Bacula File Daemon Configuration file
-#
-#  For Bacula release 1.30 (12 April 2003) -- redhat 7.3
-#
-# There is not much to change here except perhaps the
-# File daemon Name to
-#
-
-#
-# List Directors who are permitted to contact this File daemon
-#
-Director {
-  Name = @hostname@-dir
-  Password = "xevrjURYoCHhn26RaJoWbeWXEY/a3VqGKp/37tgWiuHc"
-}
-
-#
-# "Global" File daemon configuration specifications
-#
-FileDaemon {                          # this is me
-  Name = @hostname@-fd
-  FDport = 8102                  # where we listen for the director
-  WorkingDirectory = "@working_dir@"
-  Pid Directory = "@piddir@"
-  SubSys Directory = "@subsysdir@"
-}
-
-# Send all messages except skipped files back to Director
-Messages {
-  Name = Standard
-  director = @hostname@-dir = all
-}
diff --git a/regress/scripts/test-bacula-sd.conf.in b/regress/scripts/test-bacula-sd.conf.in
deleted file mode 100644 (file)
index e3145d3..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-#
-# Default Bacula Storage Daemon Configuration file
-#
-#  For Bacula release 1.30 (12 April 2003) -- redhat 7.3
-#
-# You may need to change the name of your tape drive
-#   on the "Archive Device" directive in the Device
-#   resource.  If you change the Name and/or the 
-#   "Media Type" in the Device resource, please ensure
-#   that dird.conf has corresponding changes.
-#
-
-Storage {                             # definition of myself
-  Name = @hostname@-sd
-  SDPort = 8103                  # Director's port      
-  WorkingDirectory = "@working_dir@"
-  Pid Directory = "@piddir@"
-  Subsys Directory = "@subsysdir@"
-}
-
-#
-# List Directors who are permitted to contact Storage daemon
-#
-Director {
-  Name = @hostname@-dir
-  Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"
-}
-
-#
-# Devices supported by this Storage daemon
-# To connect, the Director's bacula-dir.conf must have the
-#  same Name and MediaType. 
-#
-
-Device {
-  Name = FileStorage
-  Media Type = File
-  Archive Device = @tmpdir@
-  LabelMedia = yes;                   # lets Bacula label unlabelled media
-  Random Access = Yes;
-  AutomaticMount = yes;               # when device opened, read it
-  RemovableMedia = no;
-  AlwaysOpen = no;
-}
-
-Device {
-  Name = FileStorage1
-  Media Type = File1
-  Archive Device = @tmpdir@
-  LabelMedia = yes;                   # lets Bacula label unlabelled media
-  Random Access = Yes;
-  AutomaticMount = yes;               # when device opened, read it
-  RemovableMedia = no;
-  AlwaysOpen = no;
-}
-
-
-#Device {
-#  Name = "HP DLT 80"
-#  Media Type = DLT8000
-#  Archive Device = /dev/nst0
-#  AutomaticMount = yes;               # when device opened, read it
-#  AlwaysOpen = yes;
-#  RemovableMedia = yes;
-#}
-
-#Device {
-#  Name = SDT-7000                     # 
-#  Media Type = DDS-2
-#  Archive Device = /dev/nst0
-#  AutomaticMount = yes;               # when device opened, read it
-#  AlwaysOpen = yes;
-#  RemovableMedia = yes;
-#}
-
-#Device {
-#  Name = Floppy
-#  Media Type = Floppy
-#  Archive Device = /mnt/floppy
-#  RemovableMedia = yes;
-#  Random Access = Yes;
-#  AutomaticMount = yes;               # when device opened, read it
-#  AlwaysOpen = no;
-#}
-
-#
-# A very old Exabyte with no end of media detection
-#
-#Device {
-#  Name = "Exabyte 8mm"
-#  Media Type = "8mm"
-#  Archive Device = /dev/nst0
-#  Hardware end of medium = No;
-#  AutomaticMount = yes;               # when device opened, read it
-#  AlwaysOpen = Yes;
-#  RemovableMedia = yes;
-#}
-
-# 
-# Send all messages to the Director, 
-# mount messages also are sent to the email address
-#
-Messages {
-  Name = Standard
-  director = @hostname@-dir = all
-}
diff --git a/regress/scripts/test-console.conf.in b/regress/scripts/test-console.conf.in
deleted file mode 100644 (file)
index 0fe916b..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#
-# Bacula User Agent (or Console) Configuration File
-#
-
-Director {
-  Name = @hostname@-dir
-  DIRport = 8101
-  address = @hostname@
-  Password = "pNvX1WiXnwv2C/F7E52LGvw6rKjbbPvu2kyuPa9pVaL3"
-}
diff --git a/regress/scripts/testa-bacula-dir.conf.in b/regress/scripts/testa-bacula-dir.conf.in
deleted file mode 100644 (file)
index ed85af4..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-#
-# TestA   Bacula Director Configuration file
-#
-#  For Bacula release 1.30 (12 April 2003) -- redhat 7.3
-#
-
-Director {                            # define myself
-  Name = @hostname@-dir
-  DIRport = 8101                # where we listen for UA connections
-  QueryFile = "@scriptdir@/query.sql"
-  WorkingDirectory = "@working_dir@"
-  PidDirectory = "@piddir@"
-  SubSysDirectory = "@subsysdir@"
-  Maximum Concurrent Jobs = 1
-  Password = "pNvX1WiXnwv2C/F7E52LGvw6rKjbbPvu2kyuPa9pVaL3"         # Console password
-  Messages = Standard
-}
-
-
-Job {
-  Name = "MultiVol"
-  Type = Backup
-  Client=@hostname@-fd 
-  Level = Full
-  FileSet="Full Set"
-  Storage = File 
-  Messages = Standard
-  Write Bootstrap = "@working_dir@/SmallVols.bsr"
-  Pool = SmallVols
-}
-
-
-Job {
-  Name = "VerifyVolume"
-  Type = Verify
-  Level = VolumeToCatalog
-  Client=@hostname@-fd 
-  FileSet="Full Set"
-  Storage = File
-  Messages = Standard
-  Pool = Default
-  Write Bootstrap = "@working_dir@/NightlySave.bsr"
-}
-
-
-
-# Standard Restore template, to be changed by Console program
-Job {
-  Name = "RestoreFiles"
-  Type = Restore
-  Client=@hostname@-fd 
-  FileSet="Full Set"
-  Storage = File
-  Messages = Standard
-  Pool = Default
-  Where = /tmp/bacula-restores
-}
-
-
-# List of files to be backed up
-FileSet {
-  Name = "Full Set"
-  Include = signature=SHA1 { 
-    </tmp/file-list
-  }
-}
-
-
-# Client (File Services) to backup
-Client {
-  Name = @hostname@-fd
-  Address = @hostname@
-  FDPort = 8102
-  Catalog = MyCatalog
-  Password = "xevrjURYoCHhn26RaJoWbeWXEY/a3VqGKp/37tgWiuHc"          # password for FileDaemon
-  File Retention = 30d                # 30 days
-  Job Retention = 180d                # six months
-  AutoPrune = yes                     # Prune expired Jobs/Files
-}
-
-# Definiton of file storage device
-Storage {
-  Name = File
-  Address = @hostname@                # N.B. Use a fully qualified name here
-  SDPort = 8103
-  Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"
-  Device = FileStorage
-  Media Type = File
-}
-
-Storage {
-  Name = File1
-  Address = @hostname@                # N.B. Use a fully qualified name here
-  SDPort = 8103
-  Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"
-  Device = FileStorage1
-  Media Type = File1
-}
-
-
-# Generic catalog service
-Catalog {
-  Name = MyCatalog
-  dbname = bacula; user = bacula; password = ""
-}
-
-# Reasonable message delivery -- send most everything to email address
-#  and to the console
-Messages {
-  Name = Standard
-  mailcommand = "@sbindir@/smtp -h localhost -f \"\(Bacula Regression\) %r\" -s \"Bacula: %t %e of %c %l\" %r"
-  operatorcommand = "@sbindir@/smtp -h localhost -f \"\(Bacula Regression\) %r\" -s \"Bacula: Intervention needed for %j\" %r"
-  MailOnError = @job_email@ = all
-  operator = @job_email@ = mount
-  console = all, !skipped
-
-  append = "@working_dir@/log" = all, !skipped
-}
-
-Messages {
-  Name = NoEmail
-  mailcommand = "@sbindir@/smtp -h localhost -f \"\(Bacula Regression\) %r\" -s \"Bacula: %t %e of %c %l\" %r"
-  console = all, !skipped
-
-  append = "@working_dir@/log" = all, !skipped
-}
-
-    
-# Default pool definition
-Pool {
-  Name = Default
-  Pool Type = Backup
-  Recycle = yes                       # Bacula can automatically recycle Volumes
-  AutoPrune = yes                     # Prune expired volumes
-  Volume Retention = 365d             # one year
-  Accept Any Volume = yes             # write on any volume in the pool
-}
-
-Pool {
-  Name = SmallVols
-  Pool Type = Backup
-  Recycle = yes                       # Bacula can automatically recycle Volumes
-  AutoPrune = yes                     # Prune expired volumes
-  Volume Retention = 365d             # one year
-  Accept Any Volume = yes             # write on any volume in the pool
-  Maximum Volumes = 10
-  MaximumVolumeBytes = 10M
-  LabelFormat = Small
-}
diff --git a/regress/tests/backup-bacula-tape b/regress/tests/backup-bacula-tape
deleted file mode 100755 (executable)
index 8f669b8..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/bin/sh
-#
-# Run a simple backup of the Bacula build directory 
-#   to a tape then restore it.
-#
-cwd=`pwd`
-bin/bacula stop  2>&1 >/dev/null
-scripts/copy-tape-confs
-scripts/cleanup-tape
-echo "${cwd}/build" >/tmp/file-list
-bin/drop_sqlite_tables
-bin/make_sqlite_tables
-
-echo " "
-echo " "
-echo " === Starting Bacula tape test ==="
-echo " === Starting Bacula tape test ===" >>working/log
-echo " "
-
-bin/bacula start 2>&1 >/dev/null
-bin/console -c bin/console.conf <<END_OF_DATA
-@output /dev/null
-messages
-@output tmp/log1.out
-label storage=DDS-4 volume=TestVolume001 slot=0
-run job=NightlySave yes
-wait
-messages
-@# 
-@# now do a restore
-@#
-@output tmp/log2.out
-restore where=${cwd}/tmp/bacula-restores current all
-yes
-wait
-messages
-@output
-quit
-END_OF_DATA
-bin/bacula stop 2>&1 >/dev/null
-grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
-bstat=$?
-grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
-rstat=$?
-diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
-if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
-   echo " "
-   echo " "
-   echo "  !!!!! Bacula tape test Bacula source failed!!! !!!!! "
-   echo "  !!!!! Bacula tape test failed!!! !!!!! " >>test.out
-   echo " "
-else
-   echo "  ===== Bacula tape test Bacula source OK ===== "
-   echo "  ===== Bacula tape test OK ===== " >>test.out
-   scripts/cleanup
-fi
diff --git a/regress/tests/backup-bacula-test b/regress/tests/backup-bacula-test
deleted file mode 100755 (executable)
index dfda3bc..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/bin/sh
-#
-# Run a simple backup of the Bacula build directory
-#   then restore it.
-#
-cwd=`pwd`
-scripts/copy-confs
-scripts/cleanup
-bin/bacula stop 2>&1 >/dev/null
-bin/drop_sqlite_tables
-bin/make_sqlite_tables
-
-echo " "
-echo " "
-echo " === Starting Backup Bacula Test ==="
-echo " === Starting Backup Bacula Test ===" >>working/log
-echo " "
-
-bin/bacula start 2>&1 >/dev/null
-bin/console -c bin/console.conf <<END_OF_DATA
-@output /dev/null
-messages
-@output tmp/log1.out
-label volume=TestVolume001
-run job=Client1 yes
-wait
-messages
-@# 
-@# now do a restore
-@#
-@output tmp/log2.out  
-restore where=${cwd}/tmp/bacula-restores current all
-yes
-wait
-messages
-@output
-quit
-END_OF_DATA
-bin/bacula stop 2>&1 >/dev/null
-grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
-bstat=$?
-grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
-rstat=$?
-diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
-if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
-   echo " "
-   echo " "
-   echo "  !!!!! Backup Bacula Test failed!!! !!!!! "
-   echo "  !!!!! Backup Bacula Test failed!!! !!!!! " >>test.out
-   echo " "
-else
-   echo "  ===== Backup Bacula Test OK ===== "
-   echo "  ===== Backup Bacula Test OK ===== " >>test.out
-   scripts/cleanup
-fi
diff --git a/regress/tests/bextract-test b/regress/tests/bextract-test
deleted file mode 100755 (executable)
index fc1310b..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/bin/sh
-#
-# Run a simple backup of the Bacula build directory but 
-#   split the archive into two volumes, then build a BSR with
-#   the restore command and use bextract to restore the files.
-#
-cwd=`pwd`
-scripts/copy-test-confs
-scripts/cleanup
-echo "${cwd}/build" >/tmp/file-list
-bin/bacula stop 2>&1 >/dev/null
-bin/drop_sqlite_tables
-bin/make_sqlite_tables
-
-echo " "
-echo " "
-echo " === Starting bextract-test  ==="
-echo " === Starting bextract-test  ===" >working/log
-echo " "
-
-bin/bacula start 2>&1 >/dev/null
-bin/console -c bin/console.conf <<END_OF_DATA
-@output /dev/null
-messages
-@output tmp/log1.out
-label storage=File1 volume=TestVolume001
-label storage=File1 volume=TestVolume002
-update Volume=TestVolume001 MaxVolBytes=3000000
-run job=NightlySave storage=File1 yes
-wait
-messages
-@# 
-@# now build the bsr file
-@#
-@output tmp/log2.out
-restore where=${cwd}/tmp/bacula-restores current all
-no
-wait
-messages
-@output
-quit
-END_OF_DATA
-bin/bacula stop 2>&1 >/dev/null
-mkdir -p ${cwd}/tmp/bacula-restores
-bin/bextract -b working/restore.bsr -c bin/bacula-sd.conf ${cwd}/tmp ${cwd}/tmp/bacula-restores 2>&1 >/dev/null
-grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
-bstat=$?
-diff -r build  tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
-if [ $? != 0 -o $bstat != 0 ] ; then
-   echo " "
-   echo " "
-   echo "  !!!!! bextract-test Bacula source failed!!! !!!!! "
-   echo "  !!!!! bextract-test failed!!! !!!!! " >>test.out
-   echo " "
-else
-   echo "  ===== bextract-test Bacula source OK ===== "
-   echo "  ===== bextract-test OK ===== " >>test.out
-   scripts/cleanup
-fi
diff --git a/regress/tests/bscan-test b/regress/tests/bscan-test
deleted file mode 100755 (executable)
index aca7d1a..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/bin/sh
-#
-# Run a simple backup of the Bacula build directory but 
-#   split the archive into two volumes then bscan it
-#   into the catalog after the backup. It also to a limited
-#   extent tests the purge volume and delete volume commands.
-#
-cwd=`pwd`
-scripts/copy-test-confs
-scripts/cleanup
-echo "${cwd}/build" >/tmp/file-list
-bin/bacula stop 2>&1 >/dev/null
-bin/drop_sqlite_tables
-bin/make_sqlite_tables
-
-echo " "
-echo " "
-echo " === Starting bscan-test  ==="
-echo " === Starting bscan-test  ===" >working/log
-echo " "
-
-bin/bacula start 2>&1 >/dev/null
-bin/console -c bin/console.conf <<END_OF_DATA
-@output /dev/null
-messages
-@output tmp/log1.out
-label storage=File1
-TestVolume001
-label storage=File1
-TestVolume002
-update Volume=TestVolume001 MaxVolBytes=3000000
-run job=NightlySave storage=File1
-yes
-wait
-messages
-@output /dev/null
-@#
-@# now purge the Volume
-@#
-purge volume=TestVolume001
-purge volume=TestVolume002
-delete volume=TestVolume001
-yes
-delete volume=TestVolume002
-yes
-messages
-quit
-END_OF_DATA
-bin/bacula stop 2>&1 >/dev/null
-echo "volume=TestVolume001|TestVolume002" >tmp/bscan.bsr
-bin/bscan -w working -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf ${cwd}/tmp 2>&1 >/dev/null
-bin/bacula start 2>&1 >/dev/null
-bin/console -c bin/console.conf <<END_OF_DATA
-@output /dev/null
-messages
-@output tmp/log2.out
-@# 
-@# now do a restore
-@#
-restore where=${cwd}/tmp/bacula-restores current all
-yes
-wait
-messages
-@output
-quit
-END_OF_DATA
-bin/bacula stop 2>&1 >/dev/null
-grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
-bstat=$?
-grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
-rstat=$?
-diff -r build  tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
-if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
-   echo " "
-   echo " "
-   echo "  !!!!! bscan-test Bacula source failed!!! !!!!! "
-   echo "  !!!!! bscan-test failed!!! !!!!! " >>test.out
-   echo " "
-else
-   echo "  ===== bscan-test Bacula source OK ===== "
-   echo "  ===== bscan-test OK ===== " >>test.out
-   scripts/cleanup
-fi
diff --git a/regress/tests/bsr-opt-test b/regress/tests/bsr-opt-test
deleted file mode 100755 (executable)
index 381166f..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/bin/sh
-#
-# Run a simple backup of the Bacula build directory but 
-#   split the archive into two volumes, then restore
-#   files on only one of the volumes and ensure that
-#   the other volume is not used.  I.e. bsr optimization
-#   works.
-#
-cwd=`pwd`
-scripts/copy-test-confs
-scripts/cleanup
-echo "${cwd}/build" >/tmp/file-list
-bin/bacula stop 2>&1 >/dev/null
-bin/drop_sqlite_tables
-bin/make_sqlite_tables
-
-echo " "
-echo " "
-echo " === Starting bsr-opt-test  ==="
-echo " === Starting bsr-opt-test  ===" >working/log
-echo " "
-
-bin/bacula start 2>&1 >/dev/null
-bin/console -c bin/console.conf <<END_OF_DATA
-@output /dev/null
-messages
-@output tmp/log1.out
-label storage=File1 volume=TestVolume001
-label storage=File1 volume=TestVolume002
-update Volume=TestVolume001 MaxVolBytes=3000000
-run job=NightlySave storage=File1 yes
-wait
-messages
-@# 
-@# now do a restore
-@#
-@output tmp/log2.out
-restore where=${cwd}/tmp/bacula-restores current
-unmark *
-cd ${cwd}/build/src/cats
-mark *
-ls
-done
-yes
-wait
-messages
-@output
-quit
-END_OF_DATA
-bin/bacula stop 2>&1 >/dev/null
-grep TestVolume001 working/restore.bsr
-bsrstat=$?
-grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
-bstat=$?
-grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
-rstat=$?
-diff -r build/src/cats  tmp/bacula-restores${cwd}/build/src/cats 2>&1 >/dev/null
-if [ $? != 0 -o $bsrstat != 1 -o $bstat != 0 -o $rstat != 0 ] ; then
-   echo " "
-   echo " "
-   echo "  !!!!! bsr-opt-test Bacula source failed!!! !!!!! "
-   echo "  !!!!! bsr-opt-test failed!!! !!!!! " >>test.out
-   echo " "
-else
-   echo "  ===== bsr-opt-test Bacula source OK ===== "
-   echo "  ===== bsr-opt-test OK ===== " >>test.out
-   scripts/cleanup
-fi
diff --git a/regress/tests/compressed-test b/regress/tests/compressed-test
deleted file mode 100755 (executable)
index ac886b0..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/bin/sh
-#
-# Run a simple backup of the Bacula build directory using the compressed option
-#   then restore it.
-#
-cwd=`pwd`
-scripts/copy-test-confs
-scripts/cleanup
-echo "${cwd}/build" >/tmp/file-list
-bin/bacula stop  2>&1 >/dev/null
-bin/drop_sqlite_tables
-bin/make_sqlite_tables
-
-echo " "
-echo " "
-echo " === Starting compressed-test ==="
-echo " === Starting compressed-test ===" >>working/log
-echo " "
-
-bin/bacula start 2>&1 >/dev/null
-bin/console -c bin/console.conf <<END_OF_DATA
-@output /dev/null
-status all
-status all
-messages
-@output tmp/log1.out
-label storage=File volume=TestVolume001
-run job=CompressedTest yes
-wait
-messages
-@# 
-@# now do a restore
-@#
-@output tmp/log2.out
-restore where=${cwd}/tmp/bacula-restores
-5
-done
-yes
-wait
-messages
-@output
-quit
-END_OF_DATA
-bin/bacula stop 2>&1 >/dev/null
-grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
-bstat=$?
-grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
-rstat=$?
-diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
-if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
-   echo " "
-   echo " "
-   echo "  !!!!! compressed-test Bacula source failed!!! !!!!! "
-   echo "  !!!!! compressed-test failed!!! !!!!! " >>test.out
-   echo " "
-else
-   echo "  ===== compressed-test Bacula source OK ===== "
-   echo "  ===== compressed-test OK ===== " >>test.out
-   scripts/cleanup
-fi
diff --git a/regress/tests/concurrent-jobs-test b/regress/tests/concurrent-jobs-test
deleted file mode 100755 (executable)
index e02470e..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-#!/bin/sh
-#
-# Run two jobs at the same time
-#
-cwd=`pwd`
-scripts/copy-test-confs
-scripts/cleanup
-echo "${cwd}/tmp/largefile" >/tmp/file-list
-if test -c /dev/urandom ; then
-# Create 56MB file with random data
-   echo "Creating a 56MB file with random data ..."
-   dd if=/dev/urandom of=${cwd}/tmp/largefile bs=1024 count=55000
-else
-   echo "Creating a 56MB file with bacula-dir data ..."
-   dd if=bin/bacula-dir of=${cwd}/tmp/1 bs=1024 count=1000
-   cat ${cwd}/tmp/1 ${cwd}/tmp/1 ${cwd}/tmp/1 ${cwd}/tmp/1 ${cwd}/tmp/1 >${cwd}/tmp/2
-   rm -f ${cwd}/tmp/1
-   cat ${cwd}/tmp/2 ${cwd}/tmp/2 ${cwd}/tmp/2 ${cwd}/tmp/2 ${cwd}/tmp/2 >>${cwd}/tmp/3
-   rm -f ${cwd}/tmp/2
-   cat ${cwd}/tmp/3 ${cwd}/tmp/3 ${cwd}/tmp/3 ${cwd}/tmp/3 ${cwd}/tmp/3 >${cwd}/tmp/largefile
-   rm -f ${cwd}/tmp/3
-fi 
-
-echo "largefile created"
-bin/bacula stop 2>&1 >/dev/null
-bin/drop_sqlite_tables
-bin/make_sqlite_tables
-
-echo " "
-echo " "
-echo " === Starting concurrent-jobs-test  ==="
-echo " === Starting concurrent-jobs-test  ===" >>working/log
-echo " "
-
-bin/bacula start 2>&1 >/dev/null
-bin/console -c bin/console.conf <<END_OF_DATA
-@output /dev/null
-messages
-@output tmp/log1.out
-label storage=File volume=TestVolume001
-run job=CompressedTest level=Full yes
-run job=CompressedTest level=Full yes
-run job=CompressedTest level=Full yes
-run job=CompressedTest level=Full yes
-wait
-messages
-@# 
-@# now do a restore
-@#
-@output tmp/log2.out
-restore where=${cwd}/tmp/bacula-restores
-5
-done
-yes
-wait
-messages
-@output
-quit
-END_OF_DATA
-
-bin/bacula stop 2>&1 >/dev/null
-grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
-bstat=$?
-grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
-rstat=$?
-diff tmp/largefile  tmp/bacula-restores${cwd}/tmp/largefile 2>&1 >/dev/null
-if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
-   echo " "
-   echo " "
-   echo "  !!!!! concurrent-jobs-test Bacula source failed!!! !!!!! "
-   echo "  !!!!! concurrent-jobs-test failed!!! !!!!! " >>test.out
-   echo " "
-else
-   echo "  ===== concurrent-jobs-test Bacula source OK ===== "
-   echo "  ===== concurrent-jobs-test OK ===== " >>test.out
-   scripts/cleanup
-fi
diff --git a/regress/tests/dev-test-root b/regress/tests/dev-test-root
deleted file mode 100755 (executable)
index 8f21e22..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/bin/sh
-#
-# Run a simple backup of the Bacula build directory
-#   then restore it.
-#
-echo " "
-echo " "
-echo " === /dev save/restore test ==="
-echo " "
-echo " "
-UID=`/usr/bin/id -u`
-if [ $UID != 0 ] ; then
-   echo " "
-   echo "You must be root to run this test."
-   echo "  ===== dev test failed!!! ===== "
-   echo "  ===== dev test failed!!! ===== " >>test.out
-   echo " "
-   exit 1
-fi
-cwd=`pwd`
-scripts/copy-test-confs
-echo "/dev" >/tmp/file-list
-rm -rf /tmp/TestVolume001 /tmp/bacula-restores
-bin/bacula stop 2>&1 >/dev/null
-bin/drop_sqlite_tables
-bin/make_sqlite_tables
-bin/bacula start 2>&1 >/dev/null
-bin/console -c bin/console.conf <<END_OF_DATA
-@output /dev/null
-messages
-label storage=File
-TestVolume001
-run job=NightlySave
-yes
-wait
-messages
-@# 
-@# now do a restore
-@#
-restore
-5
-done
-yes
-@sleep 1
-wait
-messages
-@output
-quit
-END_OF_DATA
-bin/bacula stop 2>&1 >/dev/null
-cd /
-${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test dev >${cwd}/tmp/original
-cd /tmp/bacula-restores
-${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test dev >${cwd}/tmp/restored
-diff ${cwd}/tmp/original ${cwd}/tmp/restored 2>&1 >/dev/null
-if [ $? != 0 ] ; then
-   echo " "
-   echo " "
-   echo "  ===== dev test failed!!! ===== "
-   echo "  ===== dev test failed!!! ===== " >>test.out
-   echo " "
-else
-   echo "  ===== dev test OK ===== "
-   echo "  ===== dev test OK ===== " >>test.out
-   cd ${cwd}
-   scripts/cleanup
-fi
diff --git a/regress/tests/etc-test-root b/regress/tests/etc-test-root
deleted file mode 100755 (executable)
index 6459026..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/bin/sh
-#
-# Run a simple backup of the Bacula build directory
-#   then restore it.
-#
-echo " "
-echo " "
-echo " === /etc save/restore test ==="
-echo " "
-echo " "
-UID=`/usr/bin/id -u`
-if [ $UID != 0 ] ; then
-   echo " "
-   echo "You must be root to run this test."
-   echo "  ===== Test4 failed!!! ===== "
-   echo "  ===== Test4 failed!!! ===== " >>test.out
-   echo " "
-   exit 1
-fi
-cwd=`pwd`
-scripts/copy-test-confs
-echo "/etc" >/tmp/file-list
-rm -rf /tmp/TestVolume001 /tmp/bacula-restores
-bin/bacula stop 2>&1 >/dev/null
-bin/drop_sqlite_tables
-bin/make_sqlite_tables
-bin/bacula start 2>&1 >/dev/null
-bin/console -c bin/console.conf <<END_OF_DATA
-@output /dev/null
-messages
-label storage=File
-TestVolume001
-run job=NightlySave
-yes
-wait
-messages
-@# 
-@# now do a restore
-@#
-restore
-5
-done
-yes
-@sleep 1
-wait
-messages
-@output
-quit
-END_OF_DATA
-bin/bacula stop 2>&1 >/dev/null
-cd /
-${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test etc >${cwd}/tmp/original
-cd /tmp/bacula-restores
-${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test etc >${cwd}/tmp/restored
-diff ${cwd}/tmp/original ${cwd}/tmp/restored 2>&1 >/dev/null
-if [ $? != 0 ] ; then
-   echo " "
-   echo " "
-   echo "  ===== Test4 /etc failed!!! ===== "
-   echo "  ===== Test4 failed!!! ===== " >>test.out
-   echo " "
-else
-   echo "  ===== Test4 /etc OK ===== "
-   echo "  ===== Test4 OK ===== " >>test.out
-   cd ${cwd}
-   scripts/cleanup
-fi
diff --git a/regress/tests/four-concurrent-jobs-test b/regress/tests/four-concurrent-jobs-test
deleted file mode 100755 (executable)
index 0782fbd..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/bin/sh
-#
-# Run two jobs at the same time
-#
-cwd=`pwd`
-scripts/copy-test-confs
-scripts/cleanup
-echo "${cwd}/build" >/tmp/file-list
-bin/bacula stop 2>&1 >/dev/null
-bin/drop_sqlite_tables
-bin/make_sqlite_tables
-
-echo " "
-echo " "
-echo " === Starting four-concurrent-jobs-test  ==="
-echo " === Starting four-concurrent-jobs-test  ===" >>working/log
-echo " "
-
-#bin/bacula start 2>&1 >/dev/null
-bin/bacula start
-bin/console -c bin/console.conf <<END_OF_DATA
-@output /dev/null
-messages
-@output tmp/log1.out
-label storage=File1
-TestVolume001
-label storage=File1
-TestVolume002
-update Volume=TestVolume001
-6
-100000000
-@#50000000
-10
-run job=NightlySave level=Full Storage=File1
-yes
-run job=NightlySave level=Full Storage=File1
-yes
-run job=NightlySave level=Full Storage=File1
-yes
-run job=NightlySave level=Full Storage=File1
-yes
-@sleep 2
-status dir
-@sleep 5
-messages
-wait
-messages
-@# 
-@# now do a restore
-@#
-@output tmp/log2.out
-restore where=${cwd}/tmp/bacula-restores
-5
-done
-yes
-wait
-messages
-@output
-quit
-END_OF_DATA
-
-bin/bacula stop 2>&1 >/dev/null
-grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
-bstat=$?
-grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
-rstat=$?
-diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
-if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
-   echo " "
-   echo " "
-   echo "  !!!!! four-concurrent-jobs-test Bacula source failed!!! !!!!! "
-   echo "  !!!!! four-concurrent-jobs-test failed!!! !!!!! " >>test.out
-   echo " "
-   exit 1
-else
-   echo "  ===== four-concurrent-jobs-test Bacula source OK ===== "
-   echo "  ===== four-concurrent-jobs-test OK ===== " >>test.out
-   scripts/cleanup
-   exit 0
-fi
diff --git a/regress/tests/lib-test-root b/regress/tests/lib-test-root
deleted file mode 100755 (executable)
index 60320fb..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/bin/sh
-#
-# Run a simple backup of the Bacula build directory
-#   then restore it.
-#
-echo " "
-echo " "
-echo " === /lib save/restore test ==="
-echo " "
-echo " "
-UID=`/usr/bin/id -u`
-if [ $UID != 0 ] ; then
-   echo " "
-   echo "You must be root to run this test."
-   echo "  ===== Test5 failed!!! ===== "
-   echo "  ===== Test5 failed!!! ===== " >>test.out
-   echo " "
-   exit 1
-fi
-cwd=`pwd`
-scripts/copy-test-confs
-echo "/lib" >/tmp/file-list
-rm -rf /tmp/TestVolume001 /tmp/bacula-restores
-bin/bacula stop 2>&1 >/dev/null
-bin/drop_sqlite_tables
-bin/make_sqlite_tables
-bin/bacula start 2>&1 >/dev/null
-bin/console -c bin/console.conf <<END_OF_DATA
-@output /dev/null
-messages
-label storage=File
-TestVolume001
-run job=NightlySave
-yes
-wait
-messages
-@# 
-@# now do a restore
-@#
-restore
-5
-done
-yes
-@sleep 1
-wait
-messages
-@output
-quit
-END_OF_DATA
-bin/bacula stop 2>&1 >/dev/null
-cd /
-${cwd}/bin/testls -e ${cwd}/scripts/exclude-lib-test lib >${cwd}/tmp/original
-cd /tmp/bacula-restores
-${cwd}/bin/testls -e ${cwd}/scripts/exclude-lib-test lib >${cwd}/tmp/restored
-diff ${cwd}/tmp/original ${cwd}/tmp/restored 2>&1 >/dev/null
-if [ $? != 0 ] ; then
-   echo " "
-   echo " "
-   echo "  ===== Test5 /lib failed!!! ===== "
-   echo "  ===== Test5 failed!!! ===== " >>test.out
-   echo " "
-else
-   echo "  ===== Test5 /lib OK ===== "
-   echo "  ===== Test5 OK ===== " >>test.out
-   cd ${cwd}
-   scripts/cleanup
-fi
diff --git a/regress/tests/recycle-test b/regress/tests/recycle-test
deleted file mode 100755 (executable)
index 0745b88..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-#!/bin/sh
-#
-# Run a simple backup of the Bacula build directory but 
-#   create three volumes and do six backups causing the
-#   volumes to be recycled, and cycling through the volumes
-#   twice. Tests maxvoljobs and volretention.
-#
-cwd=`pwd`
-scripts/copy-test-confs
-scripts/cleanup
-echo "${cwd}/build" >/tmp/file-list
-bin/bacula stop 2>&1 >/dev/null
-bin/drop_sqlite_tables
-bin/make_sqlite_tables
-
-echo " "
-echo " "
-echo " === Starting recycle-test  ==="
-echo " === Starting recycle-test  ===" >working/log
-echo " "
-
-bin/bacula start 2>&1 >/dev/null
-bin/console -c bin/console.conf <<END_OF_DATA
-@output /dev/null
-messages
-label storage=File1 volume=TestVolume001
-label storage=File1 volume=TestVolume002
-label storage=File1 volume=TestVolume003
-update Volume=TestVolume001 volretention=10s
-update Volume=TestVolume001 maxvoljobs=1
-update Volume=TestVolume002 volretention=10s
-update Volume=TestVolume002 maxvoljobs=1
-update Volume=TestVolume003 volretention=10s
-update Volume=TestVolume003 maxvoljobs=1
-list volumes
-run job=NightlySave storage=File1 level=full yes
-wait
-messages
-list volumes
-run job=NightlySave storage=File1 level=full yes
-wait
-messages
-list volumes
-run job=NightlySave storage=File1 level=full yes
-wait
-messages
-list volumes
-@sleep 10
-run job=NightlySave storage=File1 level=full yes
-wait
-messages
-list volumes
-run job=NightlySave storage=File1 level=full yes
-wait
-messages
-@output tmp/log1.out
-list volumes
-run job=NightlySave storage=File1 level=full yes
-wait
-messages
-list volumes
-@# 
-@# now do a restore
-@#
-@output tmp/log2.out
-restore where=${cwd}/tmp/bacula-restores current all
-yes
-wait
-messages
-@output
-quit
-END_OF_DATA
-bin/bacula stop 2>&1 >/dev/null
-grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
-bstat=$?
-grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
-rstat=$?
-diff -r build  tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
-if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
-   echo " "
-   echo " "
-   echo "  !!!!! recycle-test Bacula source failed!!! !!!!! "
-   echo "  !!!!! recycle-test failed!!! !!!!! " >>test.out
-   echo " "
-else
-   echo "  ===== recycle-test Bacula source OK ===== "
-   echo "  ===== recycle-test OK ===== " >>test.out
-   scripts/cleanup
-fi
diff --git a/regress/tests/restore-by-file-test b/regress/tests/restore-by-file-test
deleted file mode 100755 (executable)
index 22d4cc7..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/bin/sh
-#
-# Run a simple backup of the Bacula build directory using the compressed option
-#   then restore it.
-#
-cwd=`pwd`
-scripts/copy-test-confs
-scripts/cleanup
-echo "${cwd}/tmp/build" >/tmp/file-list
-mkdir ${cwd}/tmp/build
-cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build
-cd ${cwd}/tmp/build
-ls >../1
-cd ..
-sed s%\^%${cwd}/tmp/build/% 1 >restore-list
-rm -f 1
-cd ${cwd}
-bin/bacula stop  2>&1 >/dev/null
-bin/drop_sqlite_tables
-bin/make_sqlite_tables
-
-echo " "
-echo " "
-echo " === Starting restore-by-file-test ==="
-echo " === Starting restore-by-file-test ===" >>working/log
-echo " "
-
-bin/bacula start 2>&1 >/dev/null
-bin/console -c bin/console.conf <<END_OF_DATA
-@output /dev/null
-messages
-@output tmp/log1.out
-label storage=File volume=TestVolume001
-run job=CompressedTest yes
-wait
-messages
-@# 
-@# now do a restore
-@#
-@output tmp/log2.out
-restore where=${cwd}/tmp/bacula-restores
-7
-<${cwd}/tmp/restore-list
-
-yes
-wait
-messages
-@output
-quit
-END_OF_DATA
-bin/bacula stop 2>&1 >/dev/null
-grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
-bstat=$?
-grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
-rstat=$?
-diff -r tmp/build tmp/bacula-restores${cwd}/tmp/build 2>&1 >/dev/null
-if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
-   echo " "
-   echo " "
-   echo "  !!!!! restore-by-file-test Bacula source failed!!! !!!!! "
-   echo "  !!!!! restore-by-file-test failed!!! !!!!! " >>test.out
-   echo " "
-else
-   echo "  ===== restore-by-file-test Bacula source OK ===== "
-   echo "  ===== restore-by-file-test OK ===== " >>test.out
-   scripts/cleanup
-fi
diff --git a/regress/tests/six-vol-test b/regress/tests/six-vol-test
deleted file mode 100755 (executable)
index 73ce4e9..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/bin/sh
-#
-# Create a 60MB file with random bytes. Back it up to 6 Volumes
-#   each constrained to 10MB using the automatic labeling feature.
-#
-
-if test ! -c /dev/urandom ; then
-   echo "No random device. Test skipped.\n"
-   exit 0
-fi
-cwd=`pwd`
-scripts/copy-testa-confs
-scripts/cleanup
-echo "${cwd}/tmp/largefile" >/tmp/file-list
-# Create 56MB file with random data
-echo "Creating a 56MB file with random data ..."
-dd if=/dev/urandom of=${cwd}/tmp/largefile bs=1024 count=55000
-echo "largefile created"
-bin/bacula stop 2>&1 >/dev/null
-bin/drop_sqlite_tables
-bin/make_sqlite_tables
-
-echo " "
-echo " "
-echo " === Starting six-vol-test  ==="
-echo " === Starting six-vol-test  ===" >>working/log
-echo " "
-
-bin/bacula start 2>&1 >/dev/null
-bin/console -c bin/console.conf <<END_OF_DATA
-@output /dev/null
-messages
-@output tmp/log1.out
-run job=MultiVol storage=File yes
-wait
-messages
-@# 
-@# now do a restore
-@#
-@output tmp/log2.out
-restore where=${cwd}/tmp/bacula-restores
-5
-done
-yes
-wait
-messages
-@output
-quit
-END_OF_DATA
-bin/bacula stop  2>&1 >/dev/null
-grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
-bstat=$?
-grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
-rstat=$?
-diff tmp/largefile  tmp/bacula-restores${cwd}/tmp/largefile 2>&1 >/dev/null
-if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
-   echo " "
-   echo " "
-   echo "  !!!!! six-vol-test Bacula source failed!!! !!!!! "
-   echo "  !!!!! six-vol-test failed!!! !!!!! " >>test.out
-   echo " "
-else
-   echo "  ===== six-vol-test Bacula source OK ===== "
-   echo "  ===== six-vol-test OK ===== " >>test.out
-   scripts/cleanup
-fi
diff --git a/regress/tests/small-file-size-tape b/regress/tests/small-file-size-tape
deleted file mode 100755 (executable)
index 743cc17..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/bin/sh
-#
-# Run a simple backup of the Bacula build directory 
-#   to a tape where the maximum tape file size is set to 1M
-#
-cwd=`pwd`
-bin/bacula stop  2>&1 >/dev/null
-scripts/copy-tape-confs
-scripts/cleanup-tape
-echo "${cwd}/build" >/tmp/file-list
-bin/drop_sqlite_tables
-bin/make_sqlite_tables
-out="tmp/sed_tmp"
-echo "s%# Maximum File Size%  Maximum File Size%g" >${out}
-cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
-sed -f ${out} ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
-
-echo " "
-echo " "
-echo " === Starting Small File Size test ==="
-echo " === Starting Small File Size test ===" >>working/log
-echo " "
-
-bin/bacula start 2>&1 >/dev/null
-bin/console -c bin/console.conf <<END_OF_DATA
-@output /dev/null
-messages
-@output tmp/log1.out
-label storage=DDS-4 volume=TestVolume001 slot=0
-run job=NightlySave yes
-wait
-messages
-@# 
-@# now do a restore
-@#
-@output tmp/log2.out
-restore where=${cwd}/tmp/bacula-restores current all
-yes
-wait
-messages
-@output
-quit
-END_OF_DATA
-bin/bacula stop 2>&1 >/dev/null
-grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
-bstat=$?
-grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
-rstat=$?
-diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
-if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
-   echo " "
-   echo " "
-   echo "  !!!!! Small File Size test Bacula source failed!!! !!!!! "
-   echo "  !!!!! Small File Size test failed!!! !!!!! " >>test.out
-   echo " "
-else
-   echo "  ===== Small File Size test Bacula source OK ===== "
-   echo "  ===== Small File Size test OK ===== " >>test.out
-#  scripts/cleanup
-fi
diff --git a/regress/tests/span-vol-test b/regress/tests/span-vol-test
deleted file mode 100755 (executable)
index a73dbfb..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/bin/sh
-#
-# Run a simple backup of the Bacula build directory but 
-#   split the archive into four volumes, two of which are
-#   totally full. I.e. make sure that bsr selects all tapes 
-#   including those fully spanned.
-#
-cwd=`pwd`
-scripts/copy-test-confs
-scripts/cleanup
-echo "${cwd}/build" >/tmp/file-list
-bin/bacula stop 2>&1 >/dev/null
-bin/drop_sqlite_tables
-bin/make_sqlite_tables
-
-echo " "
-echo " "
-echo " === Starting span-vol-test  ==="
-echo " === Starting span-vol-test  ===" >working/log
-echo " "
-
-bin/bacula start 2>&1 >/dev/null
-bin/console -c bin/console.conf <<END_OF_DATA
-@output /dev/null
-messages
-@output tmp/log1.out
-label storage=File1 volume=TestVolume001
-label storage=File1 volume=TestVolume002
-label storage=File1 volume=TestVolume003
-label storage=File1 volume=TestVolume004
-update Volume=TestVolume001 MaxVolBytes=3000000
-update Volume=TestVolume002 MaxVolBytes=3000000
-update Volume=TestVolume003 MaxVolBytes=3000000
-run job=NightlySave storage=File1 yes
-wait
-list volumes
-messages
-@# 
-@# now do a restore
-@#
-@output tmp/log2.out
-restore where=${cwd}/tmp/bacula-restores current all
-yes
-wait
-messages
-@output
-quit
-END_OF_DATA
-bin/bacula stop 2>&1 >/dev/null
-grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
-bstat=$?
-grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
-rstat=$?
-diff -r build  tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
-if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
-   echo " "
-   echo " "
-   echo "  !!!!! span-vol-test Bacula source failed!!! !!!!! "
-   echo "  !!!!! span-vol-test failed!!! !!!!! " >>test.out
-   echo " "
-else
-   echo "  ===== span-vol-test Bacula source OK ===== "
-   echo "  ===== span-vol-test OK ===== " >>test.out
-   scripts/cleanup
-fi
diff --git a/regress/tests/sparse-compressed-test b/regress/tests/sparse-compressed-test
deleted file mode 100755 (executable)
index 3f2fcb9..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/bin/sh
-#
-# Run a simple backup of the Bacula build directory using the Sparse option
-#   then restore it.
-#
-cwd=`pwd`
-scripts/copy-test-confs
-scripts/cleanup
-echo "${cwd}/build" >/tmp/file-list
-bin/bacula stop 2>&1 >/dev/null
-bin/drop_sqlite_tables
-bin/make_sqlite_tables
-
-echo " "
-echo " "
-echo " === Starting sparse-compressed-test ==="
-echo " === Starting sparse-compressed-test ===" >>working/log
-echo " "
-
-bin/bacula start 2>&1 >/dev/null
-bin/console -c bin/console.conf <<END_OF_DATA
-@output /dev/null
-messages
-@output tmp/log1.out
-label storage=File volume=TestVolume001
-run job=SparseCompressedTest yes
-wait
-messages
-@# 
-@# now do a restore
-@#
-@output tmp/log2.out   
-restore where=${cwd}/tmp/bacula-restores current all
-yes
-wait
-messages
-@output
-quit
-END_OF_DATA
-bin/bacula stop 2>&1 >/dev/null
-grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
-bstat=$?
-grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
-rstat=$?
-diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
-if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
-   echo " "
-   echo " "
-   echo "  !!!!! sparse-compressed-test Bacula source failed!!! !!!!! "
-   echo "  !!!!! sparse-compressed-test failed!!! !!!!! " >>test.out
-   echo " "
-else
-   echo "  ===== sparse-compressed-test Bacula source OK ===== "
-   echo "  ===== sparse-compressed-test OK ===== " >>test.out
-   scripts/cleanup
-fi
diff --git a/regress/tests/sparse-test b/regress/tests/sparse-test
deleted file mode 100755 (executable)
index aaecc63..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/bin/sh
-#
-# Run a simple backup of the Bacula build directory using the Sparse option
-#   then restore it.
-#
-cwd=`pwd`
-scripts/copy-test-confs
-scripts/cleanup
-echo "${cwd}/build" >/tmp/file-list
-bin/bacula stop 2>&1 >/dev/null
-bin/drop_sqlite_tables
-bin/make_sqlite_tables
-
-echo " "
-echo " "
-echo " === Starting sparse-test ==="
-echo " === Starting sparse-test ===" >>working/log
-echo " "
-
-bin/bacula start 2>&1 >/dev/null
-bin/console -c bin/console.conf <<END_OF_DATA
-@output /dev/null
-messages
-@output tmp/log1.out
-label storage=File volume=TestVolume001
-run job=SparseTest yes
-wait
-messages
-@# 
-@# now do a restore
-@#
-@output tmp/log2.out
-restore where=${cwd}/tmp/bacula-restores current all
-yes
-wait
-messages
-@output
-quit
-END_OF_DATA
-bin/bacula stop 2>&1 >/dev/null
-grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
-bstat=$?
-grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
-rstat=$?
-diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
-if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
-   echo " "
-   echo " "
-   echo "  !!!!! sparse-test Bacula source failed!!! !!!!! "
-   echo "  !!!!! sparse-test failed!!! !!!!! " >>test.out
-   echo " "
-else
-   echo "  ===== sparse-test Bacula source OK ===== "
-   echo "  ===== sparse-test OK ===== " >>test.out
-   scripts/cleanup
-fi
diff --git a/regress/tests/test0 b/regress/tests/test0
deleted file mode 100755 (executable)
index 0d0edd0..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-echo " " >test.out
-rm -f bin/working/*
diff --git a/regress/tests/two-jobs-test b/regress/tests/two-jobs-test
deleted file mode 100755 (executable)
index d848ce4..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-#!/bin/sh
-#
-# Run a simple backup of the Bacula build directory using the compressed option
-#   then backup a second time and finally restore it
-#
-cwd=`pwd`
-scripts/copy-test-confs
-scripts/cleanup
-echo "${cwd}/build" >/tmp/file-list
-bin/bacula stop 2>&1 >/dev/null
-bin/drop_sqlite_tables
-bin/make_sqlite_tables
-
-echo " "
-echo " "
-echo " === Starting two-jobs-test  ==="
-echo " === Starting two-jobs-test  ===" >>working/log
-echo " "
-
-bin/bacula start 2>&1 >/dev/null
-bin/console -c bin/console.conf <<END_OF_DATA
-@output /dev/null
-estimate job=CompressedTest listing
-estimate job=CompressedTest listing
-estimate job=CompressedTest listing
-messages
-@output tmp/log1.out
-label storage=File volume=TestVolume001
-run job=CompressedTest yes
-wait
-messages
-quit
-END_OF_DATA
-echo "Backup 1 done"
-touch ${cwd}/build/src/dird/*.c
-#
-# run a second job
-#
-bin/console -c bin/console.conf <<END_OF_DATA
-@output /dev/null
-messages
-@output tmp/log1.out
-run job=CompressedTest
-yes
-wait
-messages
-@# 
-@# now do several restores to ensure we cleanup between jobs
-@#
-@output /dev/null
-restore where=${cwd}/tmp/bacula-restores current all
-yes
-wait
-restore where=${cwd}/tmp/bacula-restores current all
-yes
-wait
-@output tmp/log2.out
-restore where=${cwd}/tmp/bacula-restores current all
-yes
-wait
-messages
-@output
-quit
-END_OF_DATA
-bin/bacula stop 2>&1 >/dev/null
-grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
-bstat=$?
-grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
-rstat=$?
-diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
-if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
-   echo " "
-   echo " "
-   echo "  !!!!! two-jobs-test Bacula source failed!!! !!!!! "
-   echo "  !!!!! two-jobs-test failed!!! !!!!! " >>test.out
-   echo " "
-else
-   echo "  ===== two-jobs-test Bacula source OK ===== "
-   echo "  ===== two-jobs-test OK ===== " >>test.out
-   scripts/cleanup
-fi
diff --git a/regress/tests/two-vol-test b/regress/tests/two-vol-test
deleted file mode 100755 (executable)
index 53ca3cf..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/bin/sh
-#
-# Run a simple backup of the Bacula build directory but 
-#   split the archive into two volumes
-#
-cwd=`pwd`
-scripts/copy-test-confs
-scripts/cleanup
-echo "${cwd}/build" >/tmp/file-list
-bin/bacula stop 2>&1 >/dev/null
-bin/drop_sqlite_tables
-bin/make_sqlite_tables
-
-echo " "
-echo " "
-echo " === Starting two-vol-test  ==="
-echo " === Starting two-vol-test  ===" >working/log
-echo " "
-
-bin/bacula start 2>&1 >/dev/null
-bin/console -c bin/console.conf <<END_OF_DATA
-@output /dev/null
-messages
-@output tmp/log1.out
-label storage=File1 volume=TestVolume001
-label storage=File1 volume=TestVolume002
-update Volume=TestVolume001
-6
-3000000
-10
-run job=NightlySave storage=File1 yes
-wait
-messages
-@# 
-@# now do a restore
-@#
-@output tmp/log2.out
-restore where=${cwd}/tmp/bacula-restores current all
-yes
-wait
-messages
-@output
-quit
-END_OF_DATA
-bin/bacula stop 2>&1 >/dev/null
-grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
-bstat=$?
-grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
-rstat=$?
-diff -r build  tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
-if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
-   echo " "
-   echo " "
-   echo "  !!!!! two-vol-test Bacula source failed!!! !!!!! "
-   echo "  !!!!! two-vol-test failed!!! !!!!! " >>test.out
-   echo " "
-else
-   echo "  ===== two-vol-test Bacula source OK ===== "
-   echo "  ===== two-vol-test OK ===== " >>test.out
-   scripts/cleanup
-fi
diff --git a/regress/tests/two-volume-tape b/regress/tests/two-volume-tape
deleted file mode 100755 (executable)
index 31c7d79..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/bin/sh
-#
-# Run a simple backup of the Bacula build directory 
-#   to two tapes where the maximum tape file size is set to 1M
-#
-cwd=`pwd`
-bin/bacula stop  2>&1 >/dev/null
-scripts/copy-tape-confs
-mtx -f /dev/sg0 unload
-mtx -f /dev/sg0 load 1
-mt -f /dev/nst0 rewind
-mt -f /dev/nst0 weof
-mtx -f /dev/sg0 unload
-mtx -f /dev/sg0 load 2
-mt -f /dev/nst0 rewind
-mt -f /dev/nst0 weof
-mtx -f /dev/sg0 unload
-echo "${cwd}/build" >/tmp/file-list
-bin/drop_sqlite_tables
-bin/make_sqlite_tables
-out="tmp/sed_tmp"
-echo "s%# Maximum File Size%  Maximum File Size%g" >${out}
-cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
-sed -f ${out} ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
-
-echo " "
-echo " "
-echo " === Starting Two Volume Tape test ==="
-echo " === Starting Two Volume Tape test ===" >>working/log
-echo " "
-
-bin/bacula start 2>&1 >/dev/null
-bin/console -c bin/console.conf <<END_OF_DATA
-@output /dev/null
-messages
-@output tmp/log1.out
-label storage=DDS-4 volume=TestVolume001 slot=1
-label storage=DDS-4 volume=TestVolume002 slot=2
-update Volume=TestVolume001 MaxVolBytes=3000000
-run job=NightlySave yes
-wait
-messages
-@# 
-@# now do a restore
-@#
-@output tmp/log2.out
-restore where=${cwd}/tmp/bacula-restores current all
-yes
-wait
-messages
-@output
-quit
-END_OF_DATA
-bin/bacula stop 2>&1 >/dev/null
-grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
-bstat=$?
-grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
-rstat=$?
-diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
-if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
-   echo " "
-   echo " "
-   echo "  !!!!! Two Volume Tape test Bacula source failed!!! !!!!! "
-   echo "  !!!!! Two Volume Tape test failed!!! !!!!! " >>test.out
-   echo " "
-else
-   echo "  ===== Two Volume Tape test Bacula source OK ===== "
-   echo "  ===== Two Volume Tape test OK ===== " >>test.out
-#  scripts/cleanup
-fi
diff --git a/regress/tests/verify-vol-test b/regress/tests/verify-vol-test
deleted file mode 100755 (executable)
index 1e841c2..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/bin/sh
-#
-# Run a simple backup of the Bacula build directory
-#   then verify the catalog.           
-#
-cwd=`pwd`
-scripts/copy-test-confs
-scripts/cleanup
-echo "${cwd}/build" >/tmp/file-list
-bin/bacula stop 2>&1 >/dev/null
-bin/drop_sqlite_tables
-bin/make_sqlite_tables
-
-echo " "
-echo " "
-echo " === Starting verify Volume Test ==="
-echo " === Starting verify Volume Test ===" >>working/log
-echo " "
-
-bin/bacula start 2>&1 >/dev/null
-bin/console -c bin/console.conf <<END_OF_DATA
-@output /dev/null
-messages
-@output tmp/log1.out
-label storage=File volume=TestVolume001
-run job=NightlySave yes
-wait
-messages
-@# 
-@# now do a verify volume
-@#
-@output ${cwd}/tmp/original
-run job=VerifyVolume
-yes
-wait
-messages
-@output
-quit
-END_OF_DATA
-sleep 2
-bin/bacula stop 2>&1 >/dev/null
-grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
-bstat=$?
-grep "^Termination: *Verify OK" ${cwd}/tmp/original 2>&1 >/dev/null
-if [ $? != 0 -o $bstat != 0 ] ; then
-   echo " "
-   echo " "
-   echo "  !!!!! Verify Volume failed!!! !!!!! "
-   echo "  !!!!! Verify Volume failed!!! !!!!! " >>test.out
-   echo " "
-else
-   echo "  ===== Verify Volume Test OK ===== "
-   echo "  ===== Verify Volume Test OK ===== " >>test.out
-   scripts/cleanup
-fi
diff --git a/regress/tests/weird-files-test b/regress/tests/weird-files-test
deleted file mode 100755 (executable)
index 7237d40..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/bin/sh
-#
-# Run a simple backup of the Bacula build directory
-#   then restore it.
-#
-if test ! -d weird-files ; then
-   echo " "
-   echo "Weird files not configured. Test not run."
-   exit 0
-fi
-cwd=`pwd`
-scripts/copy-test-confs
-scripts/cleanup
-echo "${cwd}/weird-files" >/tmp/file-list
-bin/bacula stop 2>&1 >/dev/null
-bin/drop_sqlite_tables
-bin/make_sqlite_tables
-
-echo " "
-echo " "
-echo " === Starting weird filenames test ==="
-echo " === Starting weird filenames test ===" >>working/log
-echo " "
-
-bin/bacula start 2>&1 >/dev/null
-bin/console -c bin/console.conf <<END_OF_DATA
-@output /dev/null
-messages
-@output tmp/log1.out
-label storage=File
-TestVolume001
-run job=NightlySave
-yes
-wait
-messages
-@# 
-@# now do a restore
-@#
-@output tmp/log2.out
-restore where=${cwd}/tmp/bacula-restores current all
-yes
-wait
-messages
-@output
-quit
-END_OF_DATA
-bin/bacula stop 2>&1 >/dev/null
-${cwd}/bin/testls weird-files >${cwd}/tmp/original
-cd tmp/bacula-restores${cwd}
-${cwd}/bin/testls weird-files >${cwd}/tmp/restored
-cd ${cwd}
-grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
-bstat=$?
-grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
-rstat=$?
-diff ${cwd}/tmp/original ${cwd}/tmp/restored 2>&1 >/dev/null
-if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
-   echo " "
-   echo " "
-   echo "  !!!!! Weird files test failed!!! !!!!! "
-   echo "  !!!!! Weird files test failed!!! !!!!! " >>test.out
-   echo " "
-else
-   echo "  ===== Weird files test OK ===== "
-   echo "  ===== Weird files test OK ===== " >>test.out
-   cd ${cwd}
-   scripts/cleanup
-fi
diff --git a/regress/tests/weird-files2-test b/regress/tests/weird-files2-test
deleted file mode 100755 (executable)
index a618c4e..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-#!/bin/sh
-#
-# Run a simple backup of the Bacula build directory
-#   then restore it.
-#
-if test ! -d weird-files ; then
-   echo " "
-   echo "weird files not configured. Test not run."
-   exit 0
-fi
-cwd=`pwd`
-scripts/copy-test-confs
-scripts/cleanup
-rm -rf weird-files2
-cp -a weird-files weird-files2
-echo "${cwd}/weird-files2" >/tmp/file-list
-bin/bacula stop 2>&1 >/dev/null
-bin/drop_sqlite_tables
-bin/make_sqlite_tables
-
-echo " "
-echo " "
-echo " === Starting weird filenames2 test ==="
-echo " === Starting weird filenames2 test ===" >>working/log
-echo " "
-
-bin/testls weird-files2 >${cwd}/tmp/original
-bin/bacula start 2>&1 >/dev/null
-bin/console -c bin/console.conf <<END_OF_DATA
-@output /dev/null
-messages
-@output tmp/log1.out
-label storage=File volume=TestVolume001
-run job=NightlySave yes
-wait
-messages
-@output
-quit
-END_OF_DATA
-#
-# Now mess up the a hard link, and a soft link
-#
-cd weird-files2
-rm -f hard-file2
-ln hard-file3 hard-file2
-rm -f soft-file2
-ln -s soft-file3 soft-file2
-cd ${cwd}
-bin/console -c bin/console.conf <<END_OF_DATA
-@output /dev/null
-messages
-@# 
-@# now do a restore
-@#
-@output tmp/log2.out
-restore where=
-5
-done
-yes
-wait
-messages
-@output
-quit
-END_OF_DATA
-bin/bacula stop 2>&1 >/dev/null
-bin/testls weird-files2 >${cwd}/tmp/restored
-grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
-bstat=$?
-grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
-rstat=$?
-diff ${cwd}/tmp/original ${cwd}/tmp/restored 2>&1 >/dev/null
-if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
-   echo " "
-   echo " "
-   echo "  !!!!! Weird files2 test failed!!! !!!!! "
-   echo "  !!!!! Weird files2 test failed!!! !!!!! " >>test.out
-   echo " "
-else
-   echo "  ===== Weird files2 test OK ===== "
-   echo "  ===== Weird files2 test OK ===== " >>test.out
-   cd ${cwd}
-   scripts/cleanup
-   rm -rf weird-files2
-fi
diff --git a/regress/weird-files.tar.gz b/regress/weird-files.tar.gz
deleted file mode 100644 (file)
index 0ecbe3f..0000000
Binary files a/regress/weird-files.tar.gz and /dev/null differ