/*
Bacula® - The Network Backup Solution
- Copyright (C) 2000-2008 Free Software Foundation Europe e.V.
+ Copyright (C) 2000-2009 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.
return 1;
}
-
+/*
+ * Enter with Resources locked
+ */
+static void show_disabled_jobs(UAContext *ua)
+{
+ JOB *job;
+ bool first = true;
+ foreach_res(job, R_JOB) {
+ if (!acl_access_ok(ua, Job_ACL, job->name())) {
+ continue;
+ }
+ if (!job->enabled) {
+ if (first) {
+ first = false;
+ ua->send_msg(_("Disabled Jobs:\n"));
+ }
+ ua->send_msg(" %s\n", job->name());
+ }
+ }
+ if (first) {
+ ua->send_msg(_("No disabled Jobs.\n"));
+ }
+}
struct showstruct {const char *res_name; int type;};
static struct showstruct reses[] = {
* show all
* show <resource-keyword-name> e.g. show directors
* show <resource-keyword-name>=<name> e.g. show director=HeadMan
+ * show disabled shows disabled jobs
*
*/
int show_cmd(UAContext *ua, const char *cmd)
LockRes();
for (i=1; i<ua->argc; i++) {
+ if (strcasecmp(ua->argk[i], _("disabled")) == 0) {
+ show_disabled_jobs(ua);
+ goto bail_out;
+ }
type = 0;
res_name = ua->argk[i];
if (!ua->argv[i]) { /* was a name given? */
* list clients - list clients
* list nextvol job=xx - list the next vol to be used by job
* list nextvolume job=xx - same as above.
+ * list copies jobid=x,y,z
*
*/
/* List JOBMEDIA */
} else if (strcasecmp(ua->argk[i], NT_("jobmedia")) == 0) {
- int done = FALSE;
+ bool done = false;
for (j=i+1; j<ua->argc; j++) {
if (strcasecmp(ua->argk[j], NT_("ujobid")) == 0 && ua->argv[j]) {
bstrncpy(jr.Job, ua->argv[j], MAX_NAME_LENGTH);
continue;
}
db_list_jobmedia_records(ua->jcr, ua->db, jobid, prtit, ua, llist);
- done = TRUE;
+ done = true;
}
if (!done) {
/* List for all jobs (jobid=0) */
/* List JOBLOG */
} else if (strcasecmp(ua->argk[i], NT_("joblog")) == 0) {
- int done = FALSE;
+ bool done = false;
for (j=i+1; j<ua->argc; j++) {
if (strcasecmp(ua->argk[j], NT_("ujobid")) == 0 && ua->argv[j]) {
bstrncpy(jr.Job, ua->argv[j], MAX_NAME_LENGTH);
continue;
}
db_list_joblog_records(ua->jcr, ua->db, jobid, prtit, ua, llist);
- done = TRUE;
+ done = true;
}
if (!done) {
/* List for all jobs (jobid=0) */
}
}
list_nextvol(ua, n);
+ } else if (strcasecmp(ua->argk[i], NT_("copies")) == 0) {
+ char *jobids = NULL;
+ uint32_t limit=0;
+ for (j=i+1; j<ua->argc; j++) {
+ if (strcasecmp(ua->argk[j], NT_("jobid")) == 0 && ua->argv[j]) {
+ if (is_a_number_list(ua->argv[j])) {
+ jobids = ua->argv[j];
+ }
+ } else if (strcasecmp(ua->argk[j], NT_("limit")) == 0 && ua->argv[j]) {
+ limit = atoi(ua->argv[j]);
+ }
+ }
+ db_list_copies_records(ua->jcr,ua->db,limit,jobids,prtit,ua,llist);
} else if (strcasecmp(ua->argk[i], NT_("limit")) == 0
|| strcasecmp(ua->argk[i], NT_("days")) == 0) {
/* Ignore it */
mr.PoolId = jcr->jr.PoolId;
get_job_storage(&store, job, run);
mr.StorageId = store.store->StorageId;
+ /* no need to set ScratchPoolId, since we use fnv_no_create_vol */
if (!find_next_volume_for_append(jcr, &mr, 1, fnv_no_create_vol, fnv_prune)) {
ua->error_msg(_("Could not find next Volume for Job %s (Pool=%s, Level=%s).\n"),
job->name(), pr.Name, level_to_str(run->level));