-/*
- *
- * Bootstrap Record header file
- *
- * BSR (bootstrap record) handling routines split from
- * ua_restore.c July MMIII
- *
- * Kern Sibbald, July MMII
- *
- * Version $Id$
- */
-
/*
Bacula® - The Network Backup Solution
- Copyright (C) 2002-2006 Free Software Foundation Europe e.V.
+ Copyright (C) 2002-2008 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.
(FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
Switzerland, email:ftf@fsfeurope.org.
*/
+/*
+ *
+ * Bootstrap Record header file
+ *
+ * BSR (bootstrap record) handling routines split from
+ * ua_restore.c July MMIII
+ *
+ * Kern Sibbald, July MMII
+ *
+ * Version $Id$
+ */
+
/* FileIndex entry in restore bootstrap record */
VOL_PARAMS *VolParams; /* Volume, start/end file/blocks */
RBSR_FINDEX *fi; /* File indexes this JobId */
};
+
sendit(sock, _(" SpoolSize=%s\n"), edit_uint64(res->res_job.spool_size, ed1));
}
if (res->res_job.stats_enabled) {
- sendit(sock, _(" StatsEnabled=%d\n"), res->res_job.stats_enabled);
+ sendit(sock, _(" StatsEnabled=%d\n"), res->res_job.stats_enabled);
}
if (res->res_job.JobType == JT_BACKUP) {
sendit(sock, _(" Accurate=%d\n"), res->res_job.accurate);
}
/*
- * Store JobType (backup, verify, restore)
+ * Store Migration/Copy type
*
*/
void store_migtype(LEX *lc, RES_ITEM *item, int index, int pass)
/*
Bacula® - The Network Backup Solution
- Copyright (C) 2002-2007 Free Software Foundation Europe e.V.
+ Copyright (C) 2002-2008 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.
bool close_db = false;
JCR *jcr = ua->jcr;
MEDIA_DBR mr;
+ int orig_jobtype;
+ orig_jobtype = jcr->JobType;
memset(&mr, 0, sizeof(mr));
if (sp->job->JobType == JT_BACKUP) {
jcr->db = NULL;
db_close_database(jcr, jcr->db);
}
jcr->db = ua->db; /* restore ua db to jcr */
+ jcr->JobType = orig_jobtype;
}
/*
#ifdef DEBUG
void b_free_jcr(const char *file, int line, JCR *jcr)
{
- struct s_last_job *je, last_job;
+ struct s_last_job *je;
Dmsg3(dbglvl, "Enter free_jcr jid=%u from %s:%d\n", jcr->JobId, file, line);
void free_jcr(JCR *jcr)
{
- struct s_last_job *je, last_job;
+ struct s_last_job *je;
Dmsg3(dbglvl, "Enter free_jcr jid=%u use_count=%d Job=%s\n",
jcr->JobId, jcr->use_count(), jcr->Job);
case JT_MIGRATE:
case JT_COPY:
case JT_ADMIN:
- num_jobs_run++;
- last_job.Errors = jcr->Errors;
- last_job.JobType = jcr->JobType;
- last_job.JobId = jcr->JobId;
- last_job.VolSessionId = jcr->VolSessionId;
- last_job.VolSessionTime = jcr->VolSessionTime;
- bstrncpy(last_job.Job, jcr->Job, sizeof(last_job.Job));
- last_job.JobFiles = jcr->JobFiles;
- last_job.JobBytes = jcr->JobBytes;
- last_job.JobStatus = jcr->JobStatus;
- last_job.JobLevel = jcr->JobLevel;
- last_job.start_time = jcr->start_time;
- last_job.end_time = time(NULL);
/* Keep list of last jobs, but not Console where JobId==0 */
- if (last_job.JobId > 0) {
+ if (jcr->JobId > 0) {
+ num_jobs_run++;
je = (struct s_last_job *)malloc(sizeof(struct s_last_job));
- memcpy((char *)je, (char *)&last_job, sizeof(last_job));
+ memset(je, 0, sizeof(struct s_last_job)); /* zero in case unset fields */
+ je->Errors = jcr->Errors;
+ je->JobType = jcr->JobType;
+ je->JobId = jcr->JobId;
+ je->VolSessionId = jcr->VolSessionId;
+ je->VolSessionTime = jcr->VolSessionTime;
+ bstrncpy(je->Job, jcr->Job, sizeof(je->Job));
+ je->JobFiles = jcr->JobFiles;
+ je->JobBytes = jcr->JobBytes;
+ je->JobStatus = jcr->JobStatus;
+ je->JobLevel = jcr->JobLevel;
+ je->start_time = jcr->start_time;
+ je->end_time = time(NULL);
+
if (!last_jobs) {
init_last_jobs_list();
}
General:
24May08
+kes Apply Allan Black's status dir job count patch.
ebl Add information about IMPORT/EXPORT slots in mtx-script.
kes Enhance a couple of SD debug messages.
kes Tweak unload flag setting and ensure it is set during swap.