License:
For the most part, Bacula is licensed under GPL version 2 or greater.
-Regardless of what is specified in the GPL license, Bacula may be linked
+Bacula may be linked with any libraries permitted under the GPL, or
with any non-GPLed libraries, including OpenSSL, that are required for
-its proper functioning.
+its proper functioning, providing the source code of those non-GPLed
+libraries is freely available.
+
In addition to GPL, there are also parts of Bacula that are licensed
under LGPL so that they may be used in proprietary code to interface
- Add an example of using a FIFO in dirdconf.wml
- Add an item to the FAQ about running jobs in different timezones.
- Add some examples of job editing codes.
-
- Document Dan's new --with-dir-user, ... options.
See userid.txt
- Figure out how to use ssh or stunnel to protect Bacula communications.
http://howtos.linux.com/guides/nag2/x-087-2-nfs.mountd.shtml
For 1.33
+- Check: Run = Level=Differential feb-dec 1 at 1:05 to see if wday is empty.
- Look at installation file permissions with Scott so that make install
and the rpms agree.
+- Restore attributes of directory if replace=never set but directory
+ did not exist.
+- Allow "delete job jobid=xx jobid=xxx".
+- Allow "delete job jobid=xxx,yyy,aaa-bbb" i.e. list + ranges.
+- Implement multiple Volume in "purge jobs volume=".
+- Rescue builds incorrect script files on Rufus.
+- Fix option 2 of restore -- list where file is backed up -- require Client,
+ then list last 20 backups.
+- Allow browsing the catalog to see all versions of a file (with
+ stat data on each file).
+- Finish code passing files=nnn to restore start.
+- Add level to estimate command.
+- Symbolic link a directory to another one, then backup the symbolic link.
+- Check and possibly fix problems with hard links.
+- Fix "llist jobid=xx" where no fileset or client exists.
+- Release SQLite 2.8.9
+- Add all pools in Dir conf to DB also update them to catch changed
+ LabelFormats and such.
+- Build console in client-only build.
+- Write a Qmsg() to be used in bnet.c to prevent recursion. Queue the
+ message. If dequeueing toss the messages. Lock while dequeuing so that
+ it cannot be called recursively and set dequeuing flag.
+- Add a .list all files in the restore tree (probably also a list all files)
+ Do both a long and short form.
+
+- Later:
- Add a regression test for dbcheck.
- Add disk seeking on restore.
-- Add atime preservation.
- Allow for optional cancelling of SD and FD in case DIR
gets a fatal error. Requested by Jesse Guardiani <jesse@wingnet.net>
-- Do not err job if could not write bootstrap file.
- Bizarre message: Error: Could not open WriteBootstrap file:
- Build console in client only build.
-- For "list jobs" order by EndTime.
- Add "limit=n" for "list jobs"
- Check new HAVE_WIN32 open bits.
-- Make column listing for running jobs.
- JobId Level Type Started Name Status
-- Make two tape fill test work.
- Check if the tape has moved before writing.
-- Save and restore last_job across executions.
- Implement restart of daemon.
- Handling removable disks -- see below:
- Multiple drive autochanger support -- see below.
- See comtest-xxx.zip for Windows code to talk to USB.
- Fix FreeBSD mt_count problem.
- During install, copy any console.conf to bconsole.conf.
-- Have each daemon save the last_jobs structure when exiting and
- read it back in when starting up.
-- "restore jobid=1 select" calls get_storage_xxx, which prints "JobId 1 is
- not running."
- Add FromClient and ToClient keywords on restore command (or
BackupClient RestoreClient).
- Automatic "update slots" on user configuration directive when a
slot error occurs.
-- Allow "delete job jobid=xx jobid=xxx".
-- Allow "delete job jobid=xxx,yyy,aaa-bbb" i.e. list + ranges.
-- Implement multiple Volume in "purge jobs volume=".
- Implement a JobSet, which groups any number of jobs. If the
JobSet is started, all the jobs are started together.
Allow Pool, Level, and Schedule overrides.
those of the time of the restore, not those of the originalfile.
The dates you will find in your restore log seem to be the original
creation dates
-- Rescue builds incorrect script files on Rufus.
-- Write a Qmsg() to be used in bnet.c to prevent recursion. Queue the
- message. If dequeueing toss the messages. Lock while dequeuing so that
- it cannot be called recursively and set dequeuing flag.
-- Add all pools in Dir conf to DB also update them to catch changed
- LabelFormats and such.
-- Symbolic link a directory to another one, then backup the symbolic
- link.
-- Build console in client-only build.
-- Restore attributes of directory if replace=never set but directory
- did not exist.
- Check why Phil's Verify exclude does not work.
- Phil says that Windows file sizes mismatch in Verify when they should,
and that either the file size or the catalog size was zero.
-- Fix option 2 of restore -- list where file is backed up -- require Client,
- then list last 20 backups.
-- Allow browsing the catalog to see all versions of a file (with
- stat data on each file).
-- Finish code passing files=nnn to restore start.
-- Add level to estimate command.
- Check time/dates printed during restore when using Win32 API.
- Volume "add"ed to Pool gets recycled in first use. VolBytes=0
- Get rid of 0 dates in LastWritten, ...
-- Fix "llist jobid=xx" where no fileset or client exists.
-- Release SQLite 2.8.9
- If a tape is recycled while it is mounted, Stanislav Tvrudy must do an
additional mount to deblock the job.
- From Johan Decock:
- Correct code so that FileSet MD5 is calculated for < and | filename
generation.
- Mark Volume in error on error from WEOF.
-- Why does Bacula need the drive open to do "autochanger list" ?
-- Add a .list all files in the restore tree (probably also a list all files)
- Do both a long and short form.
- Implement the Media record flag that indicates that the Volume does disk
addressing.
- Implement VolAddr, which is used when Volume is addressed like a disk,
- Look at extracting Win data from BackupRead.
- Having dashes in filenames apparently creates problems for restore
by filename.
-- Add data compare on write/read in btape "test".
- 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.
====
-=== for 1.33
+=== Done in 1.33
- Change console to bconsole.
- Change smtp to bsmtp.
- Fix time difference problem between Bacula and Client
- Dates are wrong in restore list from Win32 FD.
- Dates are wrong in catalog from Win32 FD.
- Remove h_errno from bnet.c by including proper header.
+- For "list jobs" order by EndTime.
+- Make two tape fill test work.
+- Add atime preservation.
+- Do not err job if could not write bootstrap file.
+- Save and restore last_job across executions.
+- Have each daemon save the last_jobs structure when exiting and
+ read it back in when starting up.
+- "restore jobid=1 select" calls get_storage_xxx, which prints "JobId 1 is
+ not running."
+- Make column listing for running jobs JobId Level Type Started Name Status
+- Why does Bacula need the drive open to do "autochanger list" ?
+- Add data compare on write/read in btape "test".
#
@MCOMMON@
-srcdir = .
-VPATH = .
-.PATH: .
+srcdir = .
+VPATH = .
+.PATH: .
# one up
basedir = ..
CONS_LIBS=@CONS_LIBS@
CONS_LDFLAGS=@CONS_LDFLAGS@
-.SUFFIXES: .c .o
+.SUFFIXES: .c .o
.PHONY:
.DONTCARE:
# inference rules
.c.o:
- $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) $(CONS_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
+ $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) $(CONS_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
#-------------------------------------------------------------------------
all: Makefile bconsole @STATIC_CONS@
- @echo "==== Make of console is good ===="
- @echo " "
+ @echo "==== Make of console is good ===="
+ @echo " "
bconsole: $(CONSOBJS) ../lib/libbac.a ../cats/libsql.a
- $(CXX) $(LDFLAGS) $(CONS_LDFLAGS) -L../lib -L../cats -o $@ $(CONSOBJS) \
- $(LIBS) $(DLIB) $(CONS_LIBS) -lbac -lsql -lm
+ $(CXX) $(LDFLAGS) $(CONS_LDFLAGS) -L../lib -L../cats -o $@ $(CONSOBJS) \
+ $(LIBS) $(DLIB) $(CONS_LIBS) -lbac -lsql -lm
static-bconsole: $(CONSOBJS) ../lib/libbac.a ../cats/libsql.a
- $(CXX) -static $(LDFLAGS) $(CONS_LDFLAGS) -L../lib -L../cats -o $@ $(CONSOBJS) \
- $(LIBS) $(DLIB) $(CONS_LIBS) -lbac -lsql -lm
- strip $@
+ $(CXX) -static $(LDFLAGS) $(CONS_LDFLAGS) -L../lib -L../cats -o $@ $(CONSOBJS) \
+ $(LIBS) $(DLIB) $(CONS_LIBS) -lbac -lsql -lm
+ strip $@
Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
- cd $(topdir) \
- && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+ cd $(topdir) \
+ && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
clean:
- @$(RMF) console bconsole core core.* a.out *.o *.bak *~ *.intpro *.extpro 1 2 3
- @$(RMF) static-console static-bconsole gmon.out
+ @$(RMF) console bconsole core core.* a.out *.o *.bak *~ *.intpro *.extpro 1 2 3
+ @$(RMF) static-console static-bconsole gmon.out
realclean: clean
- @$(RMF) tags console.conf bconsole.conf
+ @$(RMF) tags console.conf bconsole.conf
distclean: realclean
- if test $(srcdir) = .; then $(MAKE) realclean; fi
- (cd $(srcdir); $(RMF) Makefile; $(RMF) -r CVS)
+ if test $(srcdir) = .; then $(MAKE) realclean; fi
+ (cd $(srcdir); $(RMF) Makefile; $(RMF) -r CVS)
install: all
- $(INSTALL_PROGRAM) bconsole $(DESTDIR)$(sbindir)/bconsole
- @srcconf=bconsole.conf; \
- if test -f ${DESTDIR}${sysconfdir}/$$srcconf; then \
- destconf=$$srcconf.new; \
- echo " ==> Found existing $$srcconf, installing new conf file as $$destconf"; \
- else \
- destconf=$$srcconf; \
- fi; \
- echo "${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf"; \
- ${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf
- if test -f static-bconsole; then \
- $(INSTALL_PROGRAM) static-bconsole $(DESTDIR)$(sbindir)/static-bconsole; \
- fi
+ @if test -f ${DESTDIR}${sbindir}/console; then \
+ echo " "; \
+ echo "Warning!!! ${DESTDIR}${sbindir}console found."; \
+ echo " console has been renamed bconsole, so console"; \
+ echo " is no longer used, and you might want to delete it."; \
+ echo " "; \
+ fi
+ $(INSTALL_PROGRAM) bconsole $(DESTDIR)$(sbindir)/bconsole
+ @srcconf=bconsole.conf; \
+ if test -f ${DESTDIR}${sysconfdir}/$$srcconf; then \
+ destconf=$$srcconf.new; \
+ echo " ==> Found existing $$srcconf, installing new conf file as $$destconf"; \
+ else \
+ destconf=$$srcconf; \
+ if test -f ${DESTDIR}${sysconfdir}/console.conf; then \
+ echo "Existing console.conf moved to bconsole.conf"; \
+ @$(MV) ${DESTDIR}${sysconfdir}/console.conf ${DESTDIR}${sysconfdir}/bconsole.conf; \
+ destconf=$$srcconf.new; \
+ fi; \
+ fi; \
+ echo "${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf"; \
+ ${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf
+ if test -f static-bconsole; then \
+ $(INSTALL_PROGRAM) static-bconsole $(DESTDIR)$(sbindir)/static-bconsole; \
+ fi
uninstall:
- (cd $(DESTDIR)$(sbindir); $(RMF) bconsole static-bconsole)
- (cd $(DESTDIR)$(sysconfdir); $(RMF) bconsole.conf bconsole.conf.new)
+ (cd $(DESTDIR)$(sbindir); $(RMF) bconsole static-bconsole)
+ (cd $(DESTDIR)$(sysconfdir); $(RMF) console.conf bconsole.conf bconsole.conf.new)
# `semi'-automatic since dependencies are generated at distribution time.
depend:
- @$(MV) Makefile Makefile.bak
- @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
- @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
- @$(CC) -S -M $(CPPFLAGS) $(CONS_INC) -I$(srcdir) -I$(basedir) $(SQL_INC) *.c >> Makefile
- @if test -f Makefile ; then \
- $(RMF) Makefile.bak; \
- else \
- $(MV) Makefile.bak Makefile; \
- echo -e "Something went wrong\n\a"; \
- fi
+ @$(MV) Makefile Makefile.bak
+ @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
+ @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
+ @$(CC) -S -M $(CPPFLAGS) $(CONS_INC) -I$(srcdir) -I$(basedir) $(SQL_INC) *.c >> Makefile
+ @if test -f Makefile ; then \
+ $(RMF) Makefile.bak; \
+ else \
+ $(MV) Makefile.bak Makefile; \
+ echo -e "Something went wrong\n\a"; \
+ fi
# -----------------------------------------------------------------------
# DO NOT DELETE: nice dependency list follows
case L_BASE:
bnet_fsend(fd, levelcmd, "base", " ", 0);
break;
+ /* L_NONE is the console, sending something off to the FD */
+ case L_NONE:
case L_FULL:
bnet_fsend(fd, levelcmd, "full", " ", 0);
break;
*/
if (status != 0) {
if (jcr->JobStatus == JS_Terminated) {
- Jmsg(jcr, M_ERROR, 0, _("RunAfterJob returned non-zero status=%d\n"),
+ Jmsg(jcr, M_WARNING, 0, _("RunAfterJob returned non-zero status=%d\n"),
status);
} else {
Jmsg(jcr, M_FATAL, 0, _("RunAfterFailedJob returned non-zero status=%d\n"),
create_unique_job_name(jcr, base_name);
jcr->sched_time = jcr->start_time;
jcr->JobType = job_type;
- jcr->JobLevel = L_FULL;
+ jcr->JobLevel = L_NONE;
jcr->JobStatus = JS_Running;
jcr->JobId = 0;
/*
}
njobs = 0;
bsendmsg(ua, _("\nRunning Jobs:\n"));
- bsendmsg(ua, _("Level JobId Job Status\n"));
- bsendmsg(ua, _("====================================================================\n"));
+ bsendmsg(ua, _(" JobId Level Name Status\n"));
+ bsendmsg(ua, _("======================================================================\n"));
foreach_jcr(jcr) {
if (jcr->JobId == 0 || !acl_access_ok(ua, Job_ACL, jcr->job->hdr.name)) {
free_locked_jcr(jcr);
switch (jcr->JobType) {
case JT_ADMIN:
case JT_RESTORE:
- bstrncpy(level, " ", sizeof(level));
+ bstrncpy(level, " ", sizeof(level));
break;
default:
bstrncpy(level, level_to_str(jcr->JobLevel), sizeof(level));
- level[4] = 0;
+ level[7] = 0;
break;
}
- bsendmsg(ua, _("%-4s %6d %-20s %s\n"),
- level,
+ bsendmsg(ua, _("%6d %-6s %-20s %s\n"),
jcr->JobId,
+ level,
jcr->Job,
msg);
lock_last_jobs_list();
struct s_last_job *je;
bsendmsg(ua, _("\nTerminated Jobs:\n"));
- bsendmsg(ua, _(" JobId Level Files Bytes Status Finished Name \n"));
- bsendmsg(ua, _("======================================================================\n"));
+ bsendmsg(ua, _(" JobId Level Files Bytes Status Finished Name \n"));
+ bsendmsg(ua, _("========================================================================\n"));
foreach_dlist(je, last_jobs) {
char JobName[MAX_NAME_LENGTH];
char *termstat;
*p = 0;
}
}
- bsendmsg(ua, _("%6d %-4s %8s %14s %-7s %-8s %s\n"),
+ bsendmsg(ua, _("%6d %-6s %8s %14s %-7s %-8s %s\n"),
je->JobId,
level,
edit_uint64_with_commas(je->JobFiles, b1),
*p = 0;
}
}
- bsnprintf(buf, sizeof(buf), _("%6d %-4s %8s %14s %-7s %-8s %s\n"),
+ bsnprintf(buf, sizeof(buf), _("%6d %-6s %8s %14s %-7s %-8s %s\n"),
je->JobId,
level,
edit_uint64_with_commas(je->JobFiles, b1),
int num_jobs_run;
dlist *last_jobs = NULL;
-#define MAX_LAST_JOBS 15
+static const int max_last_jobs = 10;
-static JCR *jobs = NULL; /* pointer to JCR chain */
-static brwlock_t lock; /* lock for last jobs and JCR chain */
+static JCR *jobs = NULL; /* pointer to JCR chain */
+static brwlock_t lock; /* lock for last jobs and JCR chain */
void init_last_jobs_list()
{
int errstat;
struct s_last_job *job_entry = NULL;
if (!last_jobs) {
- last_jobs = new dlist(job_entry, &job_entry->link);
+ last_jobs = new dlist(job_entry, &job_entry->link);
if ((errstat=rwl_init(&lock)) != 0) {
Emsg1(M_ABORT, 0, _("Unable to initialize jcr_chain lock. ERR=%s\n"),
- strerror(errstat));
+ strerror(errstat));
}
}
struct s_last_job *je;
if (last_jobs) {
foreach_dlist(je, last_jobs) {
- free(je);
+ free(je);
}
delete last_jobs;
last_jobs = NULL;
return;
}
Dmsg1(010, "Read num_items=%d\n", num);
- if (num > 4 * MAX_LAST_JOBS) { /* sanity check */
+ if (num > 4 * max_last_jobs) { /* sanity check */
return;
}
for ( ; num; num--) {
if (read(fd, &job, sizeof(job)) != sizeof(job)) {
Dmsg1(000, "Read job entry. ERR=%s\n", strerror(errno));
- return;
+ return;
}
if (job.JobId > 0) {
- je = (struct s_last_job *)malloc(sizeof(struct s_last_job));
- memcpy((char *)je, (char *)&job, sizeof(job));
- if (!last_jobs) {
- init_last_jobs_list();
- }
- last_jobs->append(je);
- if (last_jobs->size() > MAX_LAST_JOBS) {
- last_jobs->remove(last_jobs->first());
- }
+ je = (struct s_last_job *)malloc(sizeof(struct s_last_job));
+ memcpy((char *)je, (char *)&job, sizeof(job));
+ if (!last_jobs) {
+ init_last_jobs_list();
+ }
+ last_jobs->append(je);
+ if (last_jobs->size() > max_last_jobs) {
+ last_jobs->remove(last_jobs->first());
+ }
}
}
}
num = last_jobs->size();
if (write(fd, &num, sizeof(num)) != sizeof(num)) {
Dmsg1(000, "Error writing num_items: ERR=%s\n", strerror(errno));
- return 0;
+ return 0;
}
foreach_dlist(je, last_jobs) {
- if (write(fd, je, sizeof(struct s_last_job)) != sizeof(struct s_last_job)) {
+ if (write(fd, je, sizeof(struct s_last_job)) != sizeof(struct s_last_job)) {
Dmsg1(000, "Error writing job: ERR=%s\n", strerror(errno));
- return 0;
- }
+ return 0;
+ }
}
}
/* Return current address */
jcr->VolumeName[0] = 0;
jcr->errmsg = get_pool_memory(PM_MESSAGE);
jcr->errmsg[0] = 0;
- strcpy(jcr->Job, "*Console*"); /* default */
- jcr->JobId = UINT32_MAX; /* temp non-zero JobId */
+ /* Setup some dummy values */
+ jcr->Job[0] = 0; /* no job name by default */
+ jcr->JobId = 0;
+ jcr->JobType = JT_ADMIN;
+ jcr->JobLevel = L_NONE;
+ jcr->JobStatus = JS_Created;
sigtimer.sa_flags = 0;
sigtimer.sa_handler = timeout_handler;
/*
* Remove a JCR from the chain
* NOTE! The chain must be locked prior to calling
- * this routine.
+ * this routine.
*/
static void remove_jcr(JCR *jcr)
{
if (!jcr) {
Emsg0(M_ABORT, 0, "NULL jcr.\n");
}
- if (!jcr->prev) { /* if no prev */
- jobs = jcr->next; /* set new head */
+ if (!jcr->prev) { /* if no prev */
+ jobs = jcr->next; /* set new head */
} else {
jcr->prev->next = jcr->next; /* update prev */
}
last_job.end_time = time(NULL);
/* Keep list of last jobs, but not Console where JobId==0 */
if (last_job.JobId > 0) {
- je = (struct s_last_job *)malloc(sizeof(struct s_last_job));
- memcpy((char *)je, (char *)&last_job, sizeof(last_job));
- if (!last_jobs) {
- init_last_jobs_list();
- }
- last_jobs->append(je);
- if (last_jobs->size() > MAX_LAST_JOBS) {
- last_jobs->remove(last_jobs->first());
- }
+ je = (struct s_last_job *)malloc(sizeof(struct s_last_job));
+ memcpy((char *)je, (char *)&last_job, sizeof(last_job));
+ if (!last_jobs) {
+ init_last_jobs_list();
+ }
+ last_jobs->append(je);
+ if (last_jobs->size() > max_last_jobs) {
+ last_jobs->remove(last_jobs->first());
+ }
}
break;
default:
}
pthread_mutex_destroy(&jcr->mutex);
- close_msg(jcr); /* close messages for this job */
+ close_msg(jcr); /* close messages for this job */
delete jcr->msg_queue;
/* do this after closing messages */
#endif
lock_jcr_chain();
- jcr->use_count--; /* decrement use count */
+ jcr->use_count--; /* decrement use count */
if (jcr->use_count < 0) {
Emsg2(M_ERROR, 0, _("JCR use_count=%d JobId=%d\n"),
- jcr->use_count, jcr->JobId);
+ jcr->use_count, jcr->JobId);
}
Dmsg3(200, "Dec free_jcr 0x%x use_count=%d jobid=%d\n", jcr, jcr->use_count, jcr->JobId);
- if (jcr->use_count > 0) { /* if in use */
+ if (jcr->use_count > 0) { /* if in use */
unlock_jcr_chain();
Dmsg2(200, "free_jcr 0x%x use_count=%d\n", jcr, jcr->use_count);
return;
}
remove_jcr(jcr);
- job_end_pop(jcr); /* pop and call hooked routines */
+ job_end_pop(jcr); /* pop and call hooked routines */
Dmsg1(200, "End job=%d\n", jcr->JobId);
if (jcr->daemon_free_jcr) {
free_common_jcr(jcr);
- close_msg(NULL); /* flush any daemon messages */
+ close_msg(NULL); /* flush any daemon messages */
unlock_jcr_chain();
Dmsg0(200, "Exit free_jcr\n");
}
*/
void free_locked_jcr(JCR *jcr)
{
- jcr->use_count--; /* decrement use count */
+ jcr->use_count--; /* decrement use count */
Dmsg2(200, "Dec free_locked_jcr 0x%x use_count=%d\n", jcr, jcr->use_count);
- if (jcr->use_count > 0) { /* if in use */
+ if (jcr->use_count > 0) { /* if in use */
return;
}
remove_jcr(jcr);
- jcr->daemon_free_jcr(jcr); /* call daemon free routine */
+ jcr->daemon_free_jcr(jcr); /* call daemon free routine */
free_common_jcr(jcr);
}
/*
- * Given a JobId, find the JCR
+ * Given a JobId, find the JCR
* Returns: jcr on success
- * NULL on failure
+ * NULL on failure
*/
JCR *get_jcr_by_id(uint32_t JobId)
{
- JCR *jcr;
+ JCR *jcr;
- lock_jcr_chain(); /* lock chain */
+ lock_jcr_chain(); /* lock chain */
for (jcr = jobs; jcr; jcr=jcr->next) {
if (jcr->JobId == JobId) {
- P(jcr->mutex);
- jcr->use_count++;
- V(jcr->mutex);
+ P(jcr->mutex);
+ jcr->use_count++;
+ V(jcr->mutex);
Dmsg2(200, "Inc get_jcr 0x%x use_count=%d\n", jcr, jcr->use_count);
- break;
+ break;
}
}
unlock_jcr_chain();
}
/*
- * Given a SessionId and SessionTime, find the JCR
+ * Given a SessionId and SessionTime, find the JCR
* Returns: jcr on success
- * NULL on failure
+ * NULL on failure
*/
JCR *get_jcr_by_session(uint32_t SessionId, uint32_t SessionTime)
{
- JCR *jcr;
+ JCR *jcr;
lock_jcr_chain();
for (jcr = jobs; jcr; jcr=jcr->next) {
if (jcr->VolSessionId == SessionId &&
- jcr->VolSessionTime == SessionTime) {
- P(jcr->mutex);
- jcr->use_count++;
- V(jcr->mutex);
+ jcr->VolSessionTime == SessionTime) {
+ P(jcr->mutex);
+ jcr->use_count++;
+ V(jcr->mutex);
Dmsg2(200, "Inc get_jcr 0x%x use_count=%d\n", jcr, jcr->use_count);
- break;
+ break;
}
}
unlock_jcr_chain();
/*
- * Given a Job, find the JCR
+ * Given a Job, find the JCR
* compares on the number of characters in Job
* thus allowing partial matches.
* Returns: jcr on success
- * NULL on failure
+ * NULL on failure
*/
JCR *get_jcr_by_partial_name(char *Job)
{
- JCR *jcr;
+ JCR *jcr;
int len;
if (!Job) {
len = strlen(Job);
for (jcr = jobs; jcr; jcr=jcr->next) {
if (strncmp(Job, jcr->Job, len) == 0) {
- P(jcr->mutex);
- jcr->use_count++;
- V(jcr->mutex);
+ P(jcr->mutex);
+ jcr->use_count++;
+ V(jcr->mutex);
Dmsg2(200, "Inc get_jcr 0x%x use_count=%d\n", jcr, jcr->use_count);
- break;
+ break;
}
}
unlock_jcr_chain();
/*
- * Given a Job, find the JCR
+ * Given a Job, find the JCR
* requires an exact match of names.
* Returns: jcr on success
- * NULL on failure
+ * NULL on failure
*/
JCR *get_jcr_by_full_name(char *Job)
{
- JCR *jcr;
+ JCR *jcr;
if (!Job) {
return NULL;
lock_jcr_chain();
for (jcr = jobs; jcr; jcr=jcr->next) {
if (strcmp(jcr->Job, Job) == 0) {
- P(jcr->mutex);
- jcr->use_count++;
- V(jcr->mutex);
+ P(jcr->mutex);
+ jcr->use_count++;
+ V(jcr->mutex);
Dmsg2(200, "Inc get_jcr 0x%x use_count=%d\n", jcr, jcr->use_count);
- break;
+ break;
}
}
unlock_jcr_chain();
int errstat;
if ((errstat=rwl_writelock(&lock)) != 0) {
Emsg1(M_ABORT, 0, "rwl_writelock failure. ERR=%s\n",
- strerror(errstat));
+ strerror(errstat));
}
}
int errstat;
if ((errstat=rwl_writeunlock(&lock)) != 0) {
Emsg1(M_ABORT, 0, "rwl_writeunlock failure. ERR=%s\n",
- strerror(errstat));
+ strerror(errstat));
}
}
watchdog_t *wd = new_watchdog();
wd->one_shot = false;
- wd->interval = 30; /* FIXME: should be configurable somewhere, even
- if only with a #define */
+ wd->interval = 30; /* FIXME: should be configurable somewhere, even
+ if only with a #define */
wd->callback = jcr_timeout_check;
register_watchdog(wd);
*/
lock_jcr_chain();
foreach_jcr(jcr) {
- free_locked_jcr(jcr); /* OK to free now cuz chain is locked */
+ free_locked_jcr(jcr); /* OK to free now cuz chain is locked */
if (jcr->JobId == 0) {
- continue;
+ continue;
}
fd = jcr->store_bsock;
if (fd) {
- timer_start = fd->timer_start;
- if (timer_start && (watchdog_time - timer_start) > fd->timeout) {
- fd->timer_start = 0; /* turn off timer */
- fd->timed_out = TRUE;
- Jmsg(jcr, M_ERROR, 0, _(
+ timer_start = fd->timer_start;
+ if (timer_start && (watchdog_time - timer_start) > fd->timeout) {
+ fd->timer_start = 0; /* turn off timer */
+ fd->timed_out = TRUE;
+ Jmsg(jcr, M_ERROR, 0, _(
"Watchdog sending kill after %d secs to thread stalled reading Storage daemon.\n"),
- watchdog_time - timer_start);
- pthread_kill(jcr->my_thread_id, TIMEOUT_SIGNAL);
- }
+ watchdog_time - timer_start);
+ pthread_kill(jcr->my_thread_id, TIMEOUT_SIGNAL);
+ }
}
fd = jcr->file_bsock;
if (fd) {
- timer_start = fd->timer_start;
- if (timer_start && (watchdog_time - timer_start) > fd->timeout) {
- fd->timer_start = 0; /* turn off timer */
- fd->timed_out = TRUE;
- Jmsg(jcr, M_ERROR, 0, _(
+ timer_start = fd->timer_start;
+ if (timer_start && (watchdog_time - timer_start) > fd->timeout) {
+ fd->timer_start = 0; /* turn off timer */
+ fd->timed_out = TRUE;
+ Jmsg(jcr, M_ERROR, 0, _(
"Watchdog sending kill after %d secs to thread stalled reading File daemon.\n"),
- watchdog_time - timer_start);
- pthread_kill(jcr->my_thread_id, TIMEOUT_SIGNAL);
- }
+ watchdog_time - timer_start);
+ pthread_kill(jcr->my_thread_id, TIMEOUT_SIGNAL);
+ }
}
fd = jcr->dir_bsock;
if (fd) {
- timer_start = fd->timer_start;
- if (timer_start && (watchdog_time - timer_start) > fd->timeout) {
- fd->timer_start = 0; /* turn off timer */
- fd->timed_out = TRUE;
- Jmsg(jcr, M_ERROR, 0, _(
+ timer_start = fd->timer_start;
+ if (timer_start && (watchdog_time - timer_start) > fd->timeout) {
+ fd->timer_start = 0; /* turn off timer */
+ fd->timed_out = TRUE;
+ Jmsg(jcr, M_ERROR, 0, _(
"Watchdog sending kill after %d secs to thread stalled reading Director.\n"),
- watchdog_time - timer_start);
- pthread_kill(jcr->my_thread_id, TIMEOUT_SIGNAL);
- }
+ watchdog_time - timer_start);
+ pthread_kill(jcr->my_thread_id, TIMEOUT_SIGNAL);
+ }
}
}
*/
static void timeout_handler(int sig)
{
- return; /* thus interrupting the function */
+ return; /* thus interrupting the function */
}
*p = 0;
}
}
- bsnprintf(buf, sizeof(buf), _("%6d %-4s %8s %14s %-7s %-8s %s\n"),
+ bsnprintf(buf, sizeof(buf), _("%6d %-6s %8s %14s %-7s %-8s %s\n"),
je->JobId,
level,
edit_uint64_with_commas(je->JobFiles, b1),
#undef VERSION
#define VERSION "1.33.4"
#define VSTRING "1"
-#define BDATE "28 Feb 2004"
-#define LSMDATE "28Feb04"
+#define BDATE "01 Mar 2004"
+#define LSMDATE "01Mar04"
/* Debug flags */
#undef DEBUG