ua->send_msg(_("%s Version: %s (%s) %s %s %s\n"), my_name, VERSION, BDATE,
HOST_OS, DISTNAME, DISTVER);
bstrftime_nc(dt, sizeof(dt), daemon_start_time);
- if (num_jobs_run == 1) {
- ua->send_msg(_("Daemon started %s, 1 Job run since started.\n"), dt);
- }
- else {
- ua->send_msg(_("Daemon started %s, %d Jobs run since started.\n"),
- dt, num_jobs_run);
- }
+ ua->send_msg(_("Daemon started %s. Jobs: run=%d, running=%d\n"), dt,
+ num_jobs_run, job_count());
ua->send_msg(_(" Heap: heap=%s smbytes=%s max_bytes=%s bufs=%s max_bufs=%s\n"),
edit_uint64_with_commas((char *)sbrk(0)-(char *)start_heap, b1),
edit_uint64_with_commas(sm_bytes, b2),
/*
Bacula® - The Network Backup Solution
- Copyright (C) 2001-2009 Free Software Foundation Europe e.V.
+ Copyright (C) 2001-2010 Free Software Foundation Europe e.V.
The main author of Bacula is Kern Sibbald, with contributions from
many others, a complete list can be found in the file AUTHORS.
*
* Kern Sibbald, August MMI
*
- * Version $Id$
- *
*/
#include "bacula.h"
my_name, VERSION, BDATE, VSS, HOST_OS, DISTNAME, DISTVER);
sendit(msg.c_str(), len, sp);
bstrftime_nc(dt, sizeof(dt), daemon_start_time);
- len = Mmsg(msg, _("Daemon started %s, %d Job%s run since started.\n"),
- dt, num_jobs_run, num_jobs_run == 1 ? "" : "s");
+ len = Mmsg(msg, _("Daemon started %s. Jobs: run=%d running=%d.\n"),
+ dt, num_jobs_run, job_count());
sendit(msg.c_str(), len, sp);
#if defined(HAVE_WIN32)
if (debug_level > 0) {
}
}
+/*
+ * Return number of Jobs
+ */
+int job_count()
+{
+ JCR *jcr;
+ int count = 0;
+
+ lock_jcr_chain();
+ for (jcr = (JCR *)jcrs->first(); jcr = (JCR *)jcrs->next(jcr); ) {
+ if (jcr->JobId > 0) {
+ count++;
+ }
+ }
+ unlock_jcr_chain();
+ return count;
+}
+
/*
* Setup to call the timeout check routine every 30 seconds
JCR *jcr_walk_start();
JCR *jcr_walk_next(JCR *prev_jcr);
void jcr_walk_end(JCR *jcr);
+int job_count();
JCR *get_jcr_from_tsd();
void set_jcr_in_tsd(JCR *jcr);
void remove_jcr_from_tsd(JCR *jcr);
/*
Bacula® - The Network Backup Solution
- Copyright (C) 2003-2009 Free Software Foundation Europe e.V.
+ Copyright (C) 2003-2010 Free Software Foundation Europe e.V.
The main author of Bacula is Kern Sibbald, with contributions from
many others, a complete list can be found in the file AUTHORS.
*
* Kern Sibbald, May MMIII
*
- * Version $Id$
*
*/
bstrftime_nc(dt, sizeof(dt), daemon_start_time);
- len = Mmsg(msg, _("Daemon started %s, %d Job%s run since started.\n"),
- dt, num_jobs_run, num_jobs_run == 1 ? "" : "s");
+ len = Mmsg(msg, _("Daemon started %s. Jobs: run=%d, running=%d.\n"),
+ dt, num_jobs_run, job_count());
sendit(msg, len, sp);
len = Mmsg(msg, _(" Heap: heap=%s smbytes=%s max_bytes=%s bufs=%s max_bufs=%s\n"),