From 2356c90498a96b4bc07305ef9e6ff111d01833ea Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Mon, 15 Aug 2005 07:25:11 +0000 Subject: [PATCH] Update version git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2314 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/autoconf/configure.in | 6 +++-- bacula/configure | 12 ++++++---- bacula/kernstodo | 9 +++++++- bacula/kes-1.37 | 9 ++++++++ bacula/src/dird/backup.c | 12 +++++----- bacula/src/dird/protos.h | 4 ++++ bacula/src/dird/pythondir.c | 39 +++++++++++++++++--------------- bacula/src/dird/ua_prune.c | 1 - bacula/src/dird/ua_purge.c | 17 ++++++-------- bacula/src/filed/backup.c | 28 +++++++++++++---------- bacula/src/findlib/create_file.c | 8 ++++++- bacula/src/version.h | 4 ++-- 12 files changed, 91 insertions(+), 58 deletions(-) diff --git a/bacula/autoconf/configure.in b/bacula/autoconf/configure.in index e0c967e9b7..a0a1aec20c 100644 --- a/bacula/autoconf/configure.in +++ b/bacula/autoconf/configure.in @@ -122,8 +122,6 @@ AM_GNU_GETTEXT([external]) if test x${prefix} = xNONE && test x${datadir} = x${prefix}/share ; then datadir=/usr/share fi -localedir=`eval echo ${datadir}/locale` -AC_DEFINE_UNQUOTED(LOCALEDIR, "$localedir") # ------------------------------------------------------------------ # If the user has not set --prefix, we set our default to nothing. @@ -138,6 +136,9 @@ if test x${prefix} = xNONE ; then prefix= fi sysconfdir=`eval echo ${sysconfdir}` +datadir=`eval echo ${datadir}` +localedir=`eval echo ${datadir}/locale` +AC_DEFINE_UNQUOTED(LOCALEDIR, "$localedir") # ------------------------------------------------------------------------- # If the user has not set --exec-prefix, we default to ${prefix} @@ -2017,6 +2018,7 @@ Configuration on `date`: PID directory: ${piddir} Subsys directory: ${subsysdir} Man directory: ${mandir} + Data directory: ${datadir} C Compiler: ${CC} ${CCVERSION} C++ Compiler: ${CXX} ${CXXVERSION} Compiler flags: ${WCFLAGS} ${CFLAGS} diff --git a/bacula/configure b/bacula/configure index a1b808ddb1..18b8b1eea8 100755 --- a/bacula/configure +++ b/bacula/configure @@ -6667,11 +6667,6 @@ _ACEOF if test x${prefix} = xNONE && test x${datadir} = x${prefix}/share ; then datadir=/usr/share fi -localedir=`eval echo ${datadir}/locale` -cat >>confdefs.h <<_ACEOF -#define LOCALEDIR "$localedir" -_ACEOF - # ------------------------------------------------------------------ # If the user has not set --prefix, we set our default to nothing. @@ -6686,6 +6681,12 @@ if test x${prefix} = xNONE ; then prefix= fi sysconfdir=`eval echo ${sysconfdir}` +datadir=`eval echo ${datadir}` +localedir=`eval echo ${datadir}/locale` +cat >>confdefs.h <<_ACEOF +#define LOCALEDIR "$localedir" +_ACEOF + # ------------------------------------------------------------------------- # If the user has not set --exec-prefix, we default to ${prefix} @@ -25265,6 +25266,7 @@ Configuration on `date`: PID directory: ${piddir} Subsys directory: ${subsysdir} Man directory: ${mandir} + Data directory: ${datadir} C Compiler: ${CC} ${CCVERSION} C++ Compiler: ${CXX} ${CXXVERSION} Compiler flags: ${WCFLAGS} ${CFLAGS} diff --git a/bacula/kernstodo b/bacula/kernstodo index f89e82461b..b136ea1ece 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -1,5 +1,5 @@ Kern's ToDo List - 04 August 2005 + 13 August 2005 Major development: Project Developer @@ -11,6 +11,11 @@ Final items for 1.37 before release: 1. Fix bugs - Tape xxx in drive 0, requested in drive 1 - The mount command does not work with drives other than 0. +- A mount should cause the SD to re-examine what Slot is + loaded. +- The SD locks on to the first available drive then + wants a Volume that is released but in another drive -- + chaos. - Look at fixing restore status stats in SD. - My database is growing @@ -30,6 +35,8 @@ Document: records have been removed from the catalog. For 1.39: +- "Resuming" a failed backup (lost line for example) by using the + failed backup as a sort of "base" job. - Look at NDMP - Email to the user when the tape is about to need changing x days before it needs changing. diff --git a/bacula/kes-1.37 b/bacula/kes-1.37 index c1e16ae882..5691cf76d7 100644 --- a/bacula/kes-1.37 +++ b/bacula/kes-1.37 @@ -4,6 +4,15 @@ General: Changes to 1.37.36: +15Aug05 +- Make datadir print on config.out listing. +- Move get FileSet record up in backup init to eliminate continual + Full save seen by Peter Sjoberg. +- Add VolumeName to read-only Python variables. +- Add VolumePurged event for Python. +- Suppress /dev/ Filesystem change prohibited INFO messages. +- Do not delete FT_RAW files before restore (allows FIFOs + to be used for restore). 13Aug05 - Add drive specification to mount, unmount, release, label, and relabel for Autochangers. Note Dir<->SD protocol has diff --git a/bacula/src/dird/backup.c b/bacula/src/dird/backup.c index afa6e277d7..af58f298a4 100644 --- a/bacula/src/dird/backup.c +++ b/bacula/src/dird/backup.c @@ -51,6 +51,12 @@ bool do_backup_init(JCR *jcr) FILESET_DBR fsr; POOL_DBR pr; + memset(&fsr, 0, sizeof(fsr); + if (!get_or_create_fileset_record(jcr, &fsr)) { + return false; + } + bstrncpy(jcr->FSCreateTime, fsr.cCreateTime, sizeof(jcr->FSCreateTime)); + /* * Get definitive Job level and since time */ @@ -97,12 +103,6 @@ bool do_backup_init(JCR *jcr) jcr->PoolId = pr.PoolId; /****FIXME**** this can go away */ jcr->jr.PoolId = pr.PoolId; - if (!get_or_create_fileset_record(jcr, &fsr)) { - return false; - } - bstrncpy(jcr->FSCreateTime, fsr.cCreateTime, sizeof(jcr->FSCreateTime)); - - Dmsg2(900, "cloned=%d run_cmds=%p\n", jcr->cloned, jcr->job->run_cmds); if (!jcr->cloned && jcr->job->run_cmds) { char *runcmd; diff --git a/bacula/src/dird/protos.h b/bacula/src/dird/protos.h index b6a3513de2..b96d60ba53 100644 --- a/bacula/src/dird/protos.h +++ b/bacula/src/dird/protos.h @@ -212,7 +212,11 @@ int prune_jobs(UAContext *ua, CLIENT *client, int JobType); int prune_volume(UAContext *ua, MEDIA_DBR *mr); /* ua_purge.c */ +bool mark_media_purged(UAContext *ua, MEDIA_DBR *mr); +void purge_files_from_volume(UAContext *ua, MEDIA_DBR *mr ); int purge_jobs_from_volume(UAContext *ua, MEDIA_DBR *mr); +void purge_files_from_job(UAContext *ua, JOB_DBR *jr); + /* ua_run.c */ extern int run_cmd(UAContext *ua, const char *cmd); diff --git a/bacula/src/dird/pythondir.c b/bacula/src/dird/pythondir.c index 5893be1d78..233f1f9ff8 100644 --- a/bacula/src/dird/pythondir.c +++ b/bacula/src/dird/pythondir.c @@ -58,29 +58,30 @@ struct s_vars { /* Read-only variables */ static struct s_vars getvars[] = { - { N_("Job"), "s"}, - { N_("Level"), "s"}, - { N_("Type"), "s"}, - { N_("JobId"), "i"}, - { N_("Client"), "s"}, - { N_("NumVols"), "i"}, - { N_("Pool"), "s"}, - { N_("Storage"), "s"}, - { N_("Catalog"), "s"}, - { N_("MediaType"), "s"}, - { N_("JobName"), "s"}, - { N_("JobStatus"), "s"}, - { N_("Priority"), "i"}, - { N_("CatalogRes"), "(sssssis)"}, + { "Job", "s"}, + { "Level", "s"}, + { "Type", "s"}, + { "JobId", "i"}, + { "Client", "s"}, + { "NumVols", "i"}, + { "Pool", "s"}, + { "Storage", "s"}, + { "Catalog", "s"}, + { "MediaType", "s"}, + { "JobName", "s"}, + { "JobStatus", "s"}, + { "Priority", "i"}, + { "VolumeName", "s"}, + { "CatalogRes", "(sssssis)"}, { NULL, NULL} }; /* Writable variables */ static struct s_vars setvars[] = { - { N_("JobReport"), "s"}, - { N_("VolumeName"), "s"}, - { N_("Priority"), "i"}, + { "JobReport", "s"}, + { "VolumeName", "s"}, + { "Priority", "i"}, { NULL, NULL} }; @@ -152,7 +153,9 @@ PyObject *job_getattr(PyObject *self, char *attrname) return Py_BuildValue(getvars[i].fmt, buf); case 12: /* Priority */ return Py_BuildValue(getvars[i].fmt, jcr->JobPriority); - case 13: /* CatalogRes */ + case 13: + return Py_BuildValue(getvars[i].fmt, jcr->VolumeName); + case 14: /* CatalogRes */ return Py_BuildValue(getvars[i].fmt, jcr->catalog->db_name, jcr->catalog->db_address, jcr->catalog->db_user, jcr->catalog->db_password, diff --git a/bacula/src/dird/ua_prune.c b/bacula/src/dird/ua_prune.c index 18641bbedc..d3c9a0f18f 100644 --- a/bacula/src/dird/ua_prune.c +++ b/bacula/src/dird/ua_prune.c @@ -26,7 +26,6 @@ #include "dird.h" /* Imported functions */ -int mark_media_purged(UAContext *ua, MEDIA_DBR *mr); /* Forward referenced functions */ diff --git a/bacula/src/dird/ua_purge.c b/bacula/src/dird/ua_purge.c index c5d969425c..fb1874695c 100644 --- a/bacula/src/dird/ua_purge.c +++ b/bacula/src/dird/ua_purge.c @@ -32,14 +32,8 @@ static int purge_files_from_client(UAContext *ua, CLIENT *client); static int purge_jobs_from_client(UAContext *ua, CLIENT *client); -void purge_files_from_volume(UAContext *ua, MEDIA_DBR *mr ); -int purge_jobs_from_volume(UAContext *ua, MEDIA_DBR *mr); -void purge_files_from_job(UAContext *ua, JOB_DBR *jr); -int mark_media_purged(UAContext *ua, MEDIA_DBR *mr); - #define MAX_DEL_LIST_LEN 1000000 - static const char *select_jobsfiles_from_client = "SELECT JobId FROM Job " "WHERE ClientId=%s " @@ -569,17 +563,20 @@ bail_out: * IF volume status is Append, Full, Used, or Error, mark it Purged * Purged volumes can then be recycled (if enabled). */ -int mark_media_purged(UAContext *ua, MEDIA_DBR *mr) +bool mark_media_purged(UAContext *ua, MEDIA_DBR *mr) { + JCR *jcr = ua->jcr; if (strcmp(mr->VolStatus, "Append") == 0 || strcmp(mr->VolStatus, "Full") == 0 || strcmp(mr->VolStatus, "Used") == 0 || strcmp(mr->VolStatus, "Error") == 0) { bstrncpy(mr->VolStatus, "Purged", sizeof(mr->VolStatus)); - if (!db_update_media_record(ua->jcr, ua->db, mr)) { - return 0; + if (!db_update_media_record(jcr, ua->db, mr)) { + return false; } - return 1; + pm_strcpy(jcr->VolumeName, mr->VolumeName); + generate_job_event(jcr, "VolumePurged"); + return true; } else { bsendmsg(ua, _("Cannot purge Volume with VolStatus=%s\n"), mr->VolStatus); } diff --git a/bacula/src/filed/backup.c b/bacula/src/filed/backup.c index 857fb499bc..31268f8b71 100644 --- a/bacula/src/filed/backup.c +++ b/bacula/src/filed/backup.c @@ -152,21 +152,25 @@ static int save_file(FF_PKT *ff_pkt, void *vjcr, bool top_level) case FT_DIRBEGIN: return 1; /* not used */ case FT_NORECURSE: + Jmsg(jcr, M_INFO, 1, _(" Recursion turned off. Will not descend into %s\n"), + ff_pkt->fname); + ff_pkt->type = FT_DIREND; /* Backup only the directory entry */ + break; case FT_NOFSCHG: - case FT_INVALIDFS: - case FT_DIREND: - if (ff_pkt->type == FT_NORECURSE) { - Jmsg(jcr, M_INFO, 1, _(" Recursion turned off. Will not descend into %s\n"), - ff_pkt->fname); - } else if (ff_pkt->type == FT_NOFSCHG) { - Jmsg(jcr, M_INFO, 1, _(" File system change prohibited. Will not descend into %s\n"), - ff_pkt->fname); - } else if (ff_pkt->type == FT_INVALIDFS) { - Jmsg(jcr, M_INFO, 1, _(" Disallowed filesystem. Will not descend into %s\n"), + /* Suppress message for /dev filesystems */ + if (strncmp(ff_pkt->fname, "/dev/", 5) != 0) { + Jmsg(jcr, M_INFO, 1, _(" Filesystem change prohibited. Will not descend into %s\n"), ff_pkt->fname); } - ff_pkt->type = FT_DIREND; /* value is used below */ - Dmsg1(130, "FT_DIR saving: %s\n", ff_pkt->link); + ff_pkt->type = FT_DIREND; /* Backup only the directory entry */ + break; + case FT_INVALIDFS: + Jmsg(jcr, M_INFO, 1, _(" Disallowed filesystem. Will not descend into %s\n"), + ff_pkt->fname); + ff_pkt->type = FT_DIREND; /* Backup only the directory entry */ + break; + case FT_DIREND: + Dmsg1(130, "FT_DIREND: %s\n", ff_pkt->link); break; case FT_SPEC: Dmsg1(130, "FT_SPEC saving: %s\n", ff_pkt->fname); diff --git a/bacula/src/findlib/create_file.c b/bacula/src/findlib/create_file.c index 8733c03e36..223d99ecd6 100644 --- a/bacula/src/findlib/create_file.c +++ b/bacula/src/findlib/create_file.c @@ -111,7 +111,13 @@ int create_file(JCR *jcr, ATTR *attr, BFILE *bfd, int replace) case FT_SPEC: case FT_REGE: /* empty file */ case FT_REG: /* regular file */ - if (exists) { + /* + * Note, we do not delete FT_RAW because these are device files + * or FIFOs that should already exist. If we blow it away, + * we may blow away a FIFO that is being used to read the + * restore data, or we may blow away a partition definition. + */ + if (exists && attr->type != FT_RAW) { /* Get rid of old copy */ if (unlink(attr->ofname) == -1) { berrno be; diff --git a/bacula/src/version.h b/bacula/src/version.h index c01e52562b..ccb575a399 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -1,8 +1,8 @@ /* */ #undef VERSION #define VERSION "1.37.36" -#define BDATE "13 August 2005" -#define LSMDATE "13Aug05" +#define BDATE "15 August 2005" +#define LSMDATE "15Aug05" /* Debug flags */ #undef DEBUG -- 2.39.5