From c3b757680a7ce444e94860a4ccd2471b9330dc7b Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sat, 21 Dec 2002 14:54:34 +0000 Subject: [PATCH] Prune SQL fix; finish Linux rescue; doc git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@245 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/Makefile.in | 3 ++- bacula/autoconf/configure.in | 3 +++ bacula/configure | 6 ++++++ bacula/kernstodo | 1 + bacula/src/Makefile.in | 8 -------- bacula/src/console/Makefile.in | 6 ++++++ bacula/src/dird/Makefile.in | 6 ++++++ bacula/src/dird/sql_cmds.c | 8 ++++---- bacula/src/dird/ua_prune.c | 20 +++++++++++++------- bacula/src/filed/Makefile.in | 6 ++++++ bacula/src/stored/Makefile.in | 4 ++++ bacula/src/version.h | 4 ++-- 12 files changed, 53 insertions(+), 22 deletions(-) diff --git a/bacula/Makefile.in b/bacula/Makefile.in index 4ab7734af8..33c8e64e23 100755 --- a/bacula/Makefile.in +++ b/bacula/Makefile.in @@ -17,7 +17,8 @@ dummy: subdirs = src scripts doc src/lib src/findlib src/cats \ @READLINE_SRC@ src/console src/dird src/filed \ - src/stored @GNOME_DIR@ src/tools + src/stored @GNOME_DIR@ src/tools \ + rescue rescue/linux FDsubdirs = src/lib src/findlib src/filed diff --git a/bacula/autoconf/configure.in b/bacula/autoconf/configure.in index ae6099b808..e95bc5365a 100644 --- a/bacula/autoconf/configure.in +++ b/bacula/autoconf/configure.in @@ -1258,6 +1258,9 @@ AC_SUBST_FILE(MCOMMON) AC_OUTPUT([autoconf/Make.common \ Makefile \ + rescue/Makefile \ + rescue/linux/Makefile \ + rescue/freebsd/Makefile \ scripts/startmysql \ scripts/stopmysql \ scripts/btraceback \ diff --git a/bacula/configure b/bacula/configure index 591214ca80..d07bb6f5d9 100755 --- a/bacula/configure +++ b/bacula/configure @@ -9411,6 +9411,9 @@ ac_given_INSTALL="$INSTALL" trap 'rm -fr `echo "autoconf/Make.common \ Makefile \ + rescue/Makefile \ + rescue/linux/Makefile \ + rescue/freebsd/Makefile \ scripts/startmysql \ scripts/stopmysql \ scripts/btraceback \ @@ -9664,6 +9667,9 @@ cat >> $CONFIG_STATUS <%s " "AND Job.ClientId=%u " - "AND Job.JobType='B' " + "AND Job.Type='B' " "AND Job.Level='F' " "AND Job.JobStatus='T' " "AND Job.FileSetId=DelCandidates.FileSetId"; @@ -96,7 +96,7 @@ char *select_verify_del = "FROM Job,DelCandidates " "WHERE Job.JobTDate>%s " "AND Job.ClientId=%u " - "AND Job.JobType='V' " + "AND Job.Type='V' " "AND Job.Level='V' " "AND Job.JobStatus='T' " "AND Job.FileSetId=DelCandidates.FileSetId"; @@ -110,7 +110,7 @@ char *select_restore_del = "FROM Job,DelCandidates " "WHERE Job.JobTDate>%s " "AND Job.ClientId=%u " - "AND Job.JobType='R'"; + "AND Job.Type='R'"; diff --git a/bacula/src/dird/ua_prune.c b/bacula/src/dird/ua_prune.c index 3189a6ed7b..a4e27daef0 100644 --- a/bacula/src/dird/ua_prune.c +++ b/bacula/src/dird/ua_prune.c @@ -410,9 +410,7 @@ int prune_jobs(UAContext *ua, CLIENT *client, int JobType) strcpy(query, cnt_DelCand); Dmsg1(100, "select sql=%s\n", query); if (!db_sql_query(ua->db, query, count_handler, (void *)&cnt)) { - if (ua->verbose) { - bsendmsg(ua, "%s", db_strerror(ua->db)); - } + bsendmsg(ua, "%s", db_strerror(ua->db)); Dmsg0(050, "Count failed\n"); goto bail_out; } @@ -444,7 +442,9 @@ int prune_jobs(UAContext *ua, CLIENT *client, int JobType) Mmsg(&query, select_verify_del, ed1, cr.ClientId); break; } - db_sql_query(ua->db, query, job_delete_handler, (void *)&del); + if (!db_sql_query(ua->db, query, job_delete_handler, (void *)&del)) { + bsendmsg(ua, "%s", db_strerror(ua->db)); + } /* * OK, now we have the list of JobId's to be pruned, first check @@ -455,16 +455,22 @@ int prune_jobs(UAContext *ua, CLIENT *client, int JobType) Dmsg1(050, "Delete JobId=%d\n", del.JobId[i]); if (!del.PurgedFiles[i]) { Mmsg(&query, del_File, del.JobId[i]); - db_sql_query(ua->db, query, NULL, (void *)NULL); + if (!db_sql_query(ua->db, query, NULL, (void *)NULL)) { + bsendmsg(ua, "%s", db_strerror(ua->db)); + } Dmsg1(050, "Del sql=%s\n", query); } Mmsg(&query, del_Job, del.JobId[i]); - db_sql_query(ua->db, query, NULL, (void *)NULL); + if (!db_sql_query(ua->db, query, NULL, (void *)NULL)) { + bsendmsg(ua, "%s", db_strerror(ua->db)); + } Dmsg1(050, "Del sql=%s\n", query); Mmsg(&query, del_JobMedia, del.JobId[i]); - db_sql_query(ua->db, query, NULL, (void *)NULL); + if (!db_sql_query(ua->db, query, NULL, (void *)NULL)) { + bsendmsg(ua, "%s", db_strerror(ua->db)); + } Dmsg1(050, "Del sql=%s\n", query); } bsendmsg(ua, _("Pruned %d %s for client %s from catalog.\n"), del.num_ids, diff --git a/bacula/src/filed/Makefile.in b/bacula/src/filed/Makefile.in index b285425e54..6b64ef74df 100755 --- a/bacula/src/filed/Makefile.in +++ b/bacula/src/filed/Makefile.in @@ -68,6 +68,12 @@ bacula-fd: $(SVROBJS) ../findlib/libfind.a ../lib/libbac.a @WIN32@ $(CXX) $(LDFLAGS) $(FD_LDFLAGS) -L../lib -L../findlib -o $@ $(SVROBJS) \ $(WIN32LIBS) $(FDLIBS) -lfind -lbac -lm $(LIBS) $(DLIB) +static-bacula-fd: $(SVROBJS) ../findlib/libfind.a ../lib/libbac.a @WIN32@ + $(CXX) $(LDFLAGS) -static -L../lib -L../findlib -o $@ $(SVROBJS) \ + $(WIN32LIBS) $(FDLIBS) -lfind -lbac -lm $(LIBS) $(DLIB) + strip $@ + + Makefile: $(srcdir)/Makefile.in $(topdir)/config.status cd $(topdir) \ && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status diff --git a/bacula/src/stored/Makefile.in b/bacula/src/stored/Makefile.in index 9414fa838e..21710b9c9f 100644 --- a/bacula/src/stored/Makefile.in +++ b/bacula/src/stored/Makefile.in @@ -81,6 +81,10 @@ all: Makefile bacula-sd bls bextract bscan btape bcopy bacula-sd: $(SVROBJS) ../lib/libbac.a $(CXX) $(LDFLAGS) $(SD_LDFLAGS) -L../lib -o $@ $(SVROBJS) $(FDLIBS) -lbac -lm $(LIBS) $(DLIB) +static-bacula-sd: $(SVROBJS) ../lib/libbac.a + $(CXX) $(LDFLAGS) $(SD_LDFLAGS) -L../lib -o $@ $(SVROBJS) $(FDLIBS) -lbac -lm $(LIBS) $(DLIB) + strip $@ + btape: $(TAPEOBJS) ../lib/libbac.a ../cats/libsql.a $(CXX) $(TTOOL_LDFLSGS) $(LDFLAGS) -L../lib -L../cats -o $@ $(TAPEOBJS) -lsql $(LIBS) $(DLIB) -lbac -lm diff --git a/bacula/src/version.h b/bacula/src/version.h index ba27ddc105..4b154e43a6 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -1,8 +1,8 @@ /* */ #define VERSION "1.28" #define VSTRING "1" -#define DATE "19 December 2002" -#define LSMDATE "19Dec02" +#define DATE "20 December 2002" +#define LSMDATE "20Dec02" /* Debug flags */ #define DEBUG 1 -- 2.39.5