]> git.sur5r.net Git - bacula/bacula/commitdiff
- Apply user supplied patch that implements No Hard Links.
authorKern Sibbald <kern@sibbald.com>
Thu, 2 Dec 2004 11:03:04 +0000 (11:03 +0000)
committerKern Sibbald <kern@sibbald.com>
Thu, 2 Dec 2004 11:03:04 +0000 (11:03 +0000)
- Document Python interface
- Add hardlink keyword patch supplied by David R Bosso <dbosso@lsit.ucsb.edu>

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1735 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/ReleaseNotes
bacula/kernstodo
bacula/src/dird/inc_conf.c
bacula/src/filed/job.c
bacula/src/findlib/find.h
bacula/src/findlib/find_one.c
bacula/src/version.h

index 0d6e53cf67c4ed31f7c00dd09df4a1e3c8caabf6..f5c936249442fb5aaa62fb91c5dfff2e35d838f9 100644 (file)
 
-          Release Notes for Bacula 1.36.1
+          Release Notes for Bacula 1.37.1
 
-  Bacula code: Total files = 396 Total lines = 116,418 (*.h *.c *.in)
+  Bacula code: Total files = 398 Total lines = 117,151 (*.h *.c *.in)
 
 
 Major Changes:
-- There is a new Win32 pebuilder rescue disk thanks to Scott. This
-  is worth the effort to checkout.
-- A number of indexes have been removed from the PostgreSQL
-  database to improve performance during backups. You may need to
-  add these indexes if you do Verifies. See the scripts.
-- We now have a Gentoo ebuild -- thanks Scott.
-- There are a number of new ./configure options for the 
-  bimagemgr. Please see the documentation or ./configure --help
-- The RedHat autostart scripts disable using /lib/tls. If you
-  don't want this you will need to turn it off.
-- Corrected a problem with the default SD and FD conf files that
-  incorrectly set Maximum Concurrent Jobs = 1. This prevented
-  running a job and obtaining the status at the same time.
-- All daemon messages are now prefixed with a short date/time,
-  and queued messages (generated in the comm routines) have the
-  time the message was generated rather than the time the message
-  was sent (usually much later).
-- Fixed a bug with the autochanger code not respecting the InChanger
-  flag.
+- Preliminary Python Event support has been added. See below for
+  configuration.
+  A Python script will be called at particular points or conditions
+  in Bacula called Events. The currently defined Events are called:
+
+  StartJob, EndJob, NewVolume
+
+  Where StartJob is called before the RunBeforeJob, EndJob is called after
+  RunAfterJob, and NewVolume, is called before all other "methods" of
+  obtaining a new Volume name, when one is needed.
+
+  The Python script of the same name as the Event name (but with a .py) 
+  is called from the Scripts Directory (a directive defined in the
+  Director resource).  Note, both the Filename, and the name of
+  the function in the file must correspond to the Event name.
+
+  Once the Python script gets control, it can have access to Bacula
+  variables by doing:
+
+  import bacula
+
+  The script is called with one argument, typically called j. This
+  argument *must* be passed unchanged to each bacula function. The
+  format of the call is slightly different for reading Bacula
+  variable and for writing bacula variables. See below.
+
+  Bacula variables can be read with:
+
+  bacula.get(j, "Variable-name")
+
+  where j is the argument passed to the function, and Variable-name
+  is on of the following:
+
+   JoId, Client, Pool, Storage, Catalog, MediaType, NumVols, DirName,
+     Level, Type, Job, JobName, JobStatus
+
+   Bacula varibles can be set using Python keyword arguments:
+
+   bacula.set(jcr=j, VolumeName="xyz")
+
+   The two currently implemented writable "variables" are:
+
+   VolumeName and JobReport
+
+   Example:
+
+== File EndJob.py ===
+import bacula
+
+def EndJob(j):
+    jobid = bacula.get(j, "JobId")
+    client = bacula.get(j, "Client") 
+    bacula.set(jcr=j, JobReport="EndJob output: JobId=%d Client=%s.\n" % (jobid, client))
+    return 1
+====
+
+== File NewVolume.py ===
+import bacula
+
+def NewVolume(j):
+    jobid = bacula.get(j, "JobId")
+    print "JobId=", jobid
+    client = bacula.get(j, "Client") 
+    print "Client=" + client
+    numvol = bacula.get(j, "NumVols");
+    print "NumVols=", numvol
+    bacula.set(jcr=j, JobReport="New Volume set for Job.\n") 
+    bacula.set(jcr=j, VolumeName="TestA-001")
+    return 1
+====
 
 
 New Directives:
-- None since 1.36.0
+- Scripts Directory = <directory> name.  Defines the directory from 
+  which Bacula scripts will be called for events. In fact, Bacula
+  appends this name to the standard Python list of search directories,
+  so the script could also be in any of the Python system directories.
+- In FileSet, you can exclude backing up of hardlinks (if you have
+  a lot, it can be very expensive), by using:
+    HardLinks = no
+  in the Options section. Patch supplied by David R Bosso. Thanks.              
 
 New Commands:
-- None since 1.36.0
+- "python restart" restarts the Python interpreter. Rather brutal, make
+   sure no Python scripts are running. This permits you to change
+   a Python script and get Bacula to use the new script.
 
 Items to note!!!
-- The output from Job reports has been modified to include the 
-  seconds on the start/end times, the Storage device used, and to
-  indent the output differently.
-- If you created a PostgreSQL database under version 1.36.0, there
-  are two things you might want to do. 1. manually remove some
-  of the File table indexes to improve backup performance. See the
-  make_postgresql_tables script. 2. run fix_postgresql_tables (in
-  src/cats and updatedb) to correct a table. This is necessary only
-  if you are creating disk Volumes greater than 2GB.
-- As of 1.35.5 you MUST do a database update.
-  
-  cd scripts-dir (or src/cats)
-  ./update_bacula_tables
-   
-- All daemons should be compatible with 1.34 with the exception
-  of the new FileSet features such as regular expressions.
-- Regular expressions are not supported in the Win32 FD.
+- You must add --with-python=[DIR] to the configure command line
+  if you want Python support.  Python 2.2 and 2.3 should be automatically
+  detected if in the standard place.
+- With Python 2.2 version, the link of the Director gets a few linker
+  warnings due to the fact that Python pulls in some old non-secure
+  libraries.
+- With Python 2.3, there are a few compiler warnings.
 
 Other Items:
-- It is now possible to build the Rescue CDROM using a pre-installed
-  static Bacula FD.
-- Corrected a bug in the traceback code when Bacula was executed without
-  a path. Tracebacks should now work in more cases.
-- Corrected a typo in the traceback script.
-- Fixed the mtx autochanger script so that it correctly waits on
-  Linux systems (if you manually enable the code).
-- Added grant all on cdimages for PostgreSQL users of bimagemgr.
-- The actual Job start time is now correctly recorded in the catalog.
-- You can now specify a JobId (or multiple ones separated by commas) on
-  the restore command line.
-- A -d50 will now turn on lots of debug code if you are having
-  authentication errors.
-- Found a workaround to a /lib/tls pthreads bug (a library seg fault).
-- Added an ALERT message class for Alert messages.
-- Fixed a seg fault in the restore tree routine when attempting
-  to select certain files in the root directory.
-- Allow other jobs to request new Volumes while operator intervention
-  is needed -- previously all stalled.
-- Enhancements to btape test (don't loop if certain tape errors occur).
-- Improvements to the Win32 install.
-
index 164768cce9da240ff1af9ca172df82f1bd8f72a6..14ebef85a8e29d82cb4beea7fc55892e67138840 100644 (file)
@@ -40,6 +40,28 @@ Regression tests:
 
 
 1.37 Possibilities:
+- Add offline command to Bacula console.
+- I've seen an error when my catalog's File table fills up.  I
+   then have to recreate the File table with a larger maximum row
+   size.  Relevant information is at
+   http://dev.mysql.com/doc/mysql/en/Full_table.html ; I think the
+   "Installing and Configuring MySQL" chapter should talk a bit
+   about this potential problem, and recommend a solution.
+- For Solaris must use POSIX awk.
+- Want speed of writing to tape while despooling.
+- Supported autochanger:
+OS: Linux
+Man.: HP
+Media: LTO-2
+Model: SSL1016
+Slots: 16
+Cap: 200GB
+- Save mount point for directories not traversed with  
+  onefs=yes.
+- Implement WildFile and WildDir to solve problem of 
+  saving only *.doc files.
+- Add regex from http://www.pcre.org to Bacula for Win32.
+- Cancel command should include JobId in list of Jobs.
 - Require restore via the restore command or make a restore Job
   get the bootstrap file.
 - Use only shell tools no make in CDROM package.
index c3a01f4ef3ade4cd22719dbb80e08bee90e6c5ae..16cb3b50b2bb8f1a91230e9fab510ea8c20de6fc 100644 (file)
@@ -79,6 +79,7 @@ static RES_ITEM options_items[] = {
    {"onefs",           store_opts,    NULL,     0, 0, 0},
    {"recurse",         store_opts,    NULL,     0, 0, 0},
    {"sparse",          store_opts,    NULL,     0, 0, 0},
+   {"hardlinks",       store_opts,    NULL,     0, 0, 0},
    {"readfifo",        store_opts,    NULL,     0, 0, 0},
    {"replace",         store_opts,    NULL,     0, 0, 0},
    {"portable",        store_opts,    NULL,     0, 0, 0},
@@ -106,6 +107,7 @@ enum {
    INC_KW_ONEFS,
    INC_KW_RECURSE,
    INC_KW_SPARSE,
+   INC_KW_HARDLINK,
    INC_KW_REPLACE,              /* restore options */
    INC_KW_READFIFO,             /* Causes fifo data to be read */
    INC_KW_PORTABLE,
@@ -127,6 +129,7 @@ static struct s_kw FS_option_kw[] = {
    {"onefs",       INC_KW_ONEFS},
    {"recurse",     INC_KW_RECURSE},
    {"sparse",      INC_KW_SPARSE},
+   {"hardlinks",   INC_KW_HARDLINK},
    {"replace",     INC_KW_REPLACE},
    {"readfifo",    INC_KW_READFIFO},
    {"portable",    INC_KW_PORTABLE},
@@ -172,6 +175,8 @@ static struct s_fs_opt FS_options[] = {
    {"no",       INC_KW_RECURSE,       "h"},
    {"yes",      INC_KW_SPARSE,        "s"},
    {"no",       INC_KW_SPARSE,        "0"},
+   {"yes",      INC_KW_HARDLINK,      "0"},
+   {"no",       INC_KW_HARDLINK,      "H"},
    {"always",   INC_KW_REPLACE,       "a"},
    {"ifnewer",  INC_KW_REPLACE,       "w"},
    {"never",    INC_KW_REPLACE,       "n"},
index 9733e0b53713a488662d2da5b678b861d6a5630b..2ecc32735cf61505b4c958a4ac00f5abd44a622e 100644 (file)
@@ -861,6 +861,9 @@ static void set_options(findFOPTS *fo, const char *opts)
       case 'h':                 /* no recursion */
         fo->flags |= FO_NO_RECURSION;
         break;
+      case 'H':                 /* no hard link handling */
+        fo->flags |= FO_NO_HARDLINK;
+        break;
       case 'M':                 /* MD5 */
         fo->flags |= FO_MD5;
         break;
index dcd438f7bd5988280a554967b3bf2511f5205704..c4d2efa8cb8cba158b67cb5ceae4806a9cebb4d7 100755 (executable)
@@ -91,6 +91,7 @@ enum {
 #define FO_KEEPATIME    (1<<12)       /* Reset access time */
 #define FO_EXCLUDE      (1<<13)       /* Exclude file */
 #define FO_ACL          (1<<14)       /* Backup ACLs */
+#define FO_NO_HARDLINK  (1<<15)       /* don't handle hard links */
 
 struct s_included_file {
    struct s_included_file *next;
index 15ff905d191ae55cbf099b3cb868cd5ae044f203..784fe6f819d131c1a31959e65b70e8ff706cc8be 100755 (executable)
@@ -121,7 +121,8 @@ find_one_file(JCR *jcr, FF_PKT *ff_pkt, int handle_file(FF_PKT *ff, void *hpkt),
     *  allows us to ensure that the data of each file gets backed 
     *  up only once.
     */
-   if (ff_pkt->statp.st_nlink > 1
+   if (!(ff_pkt->flags & FO_NO_HARDLINK)
+       && ff_pkt->statp.st_nlink > 1
        && (S_ISREG(ff_pkt->statp.st_mode)
           || S_ISCHR(ff_pkt->statp.st_mode)
           || S_ISBLK(ff_pkt->statp.st_mode)
index 10d0c573da5f291ec565c2f38e583161827b848a..0dcfe754d66bb01f7c58de867abc2e706c8db571 100644 (file)
@@ -1,8 +1,8 @@
 /* */
 #undef  VERSION
 #define VERSION "1.37.1"
-#define BDATE   "01 December 2004"
-#define LSMDATE "01Dec04"
+#define BDATE   "02 December 2004"
+#define LSMDATE "02Dec04"
 
 /* Debug flags */
 #undef  DEBUG