void db_list_files_for_job(JCR *jcr, B_DB *db, uint32_t jobid, DB_LIST_HANDLER sendit, void *ctx);
void db_list_media_records(JCR *jcr, B_DB *mdb, MEDIA_DBR *mdbr, DB_LIST_HANDLER *sendit, void *ctx, e_list_type type);
void db_list_jobmedia_records(JCR *jcr, B_DB *mdb, JobId_t JobId, DB_LIST_HANDLER *sendit, void *ctx, e_list_type type);
+void db_list_joblog_records(JCR *jcr, B_DB *mdb, JobId_t JobId, DB_LIST_HANDLER *sendit, void *ctx, e_list_type type);
int db_list_sql_query(JCR *jcr, B_DB *mdb, const char *query, DB_LIST_HANDLER *sendit, void *ctx, int verbose, e_list_type type);
void db_list_client_records(JCR *jcr, B_DB *mdb, DB_LIST_HANDLER *sendit, void *ctx, e_list_type type);
}
+void db_list_joblog_records(JCR *jcr, B_DB *mdb, uint32_t JobId,
+ DB_LIST_HANDLER *sendit, void *ctx, e_list_type type)
+{
+ char ed1[50];
+ db_lock(mdb);
+ if (JobId <= 0) {
+ return;
+ }
+ if (type == VERT_LIST) {
+ Mmsg(mdb->cmd, "SELECT Time,LogText FROM Log "
+ "WHERE Log.JobId=%s", edit_int64(JobId, ed1));
+ } else {
+ Mmsg(mdb->cmd, "SELECT LogText FROM Log "
+ "WHERE Log.JobId=%s", edit_int64(JobId, ed1));
+ }
+ if (!QUERY_DB(jcr, mdb, mdb->cmd)) {
+ goto bail_out;
+ }
+
+ list_result(jcr, mdb, sendit, ctx, type);
+
+ sql_free_result(mdb);
+
+bail_out:
+ db_unlock(mdb);
+}
+
/*
* List Job record(s) that match JOB_DBR
* list jobname=name - same as above
* list jobmedia jobid=<nn>
* list jobmedia job=name
+ * list joblog jobid=<nn>
+ * list joblog job=name
* list files jobid=<nn> - list files saved for job nn
* list files job=name
* list pools - list pool records
db_list_jobmedia_records(ua->jcr, ua->db, 0, prtit, ua, llist);
}
+ /* List JOBLOG */
+ } else if (strcasecmp(ua->argk[i], NT_("joblog")) == 0) {
+ int 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);
+ jr.JobId = 0;
+ db_get_job_record(ua->jcr, ua->db, &jr);
+ jobid = jr.JobId;
+ } else if (strcasecmp(ua->argk[j], NT_("jobid")) == 0 && ua->argv[j]) {
+ jobid = str_to_int64(ua->argv[j]);
+ } else {
+ continue;
+ }
+ db_list_joblog_records(ua->jcr, ua->db, jobid, prtit, ua, llist);
+ done = TRUE;
+ }
+ if (!done) {
+ /* List for all jobs (jobid=0) */
+ db_list_joblog_records(ua->jcr, ua->db, 0, prtit, ua, llist);
+ }
+
+
/* List POOLS */
} else if (strcasecmp(ua->argk[i], NT_("pool")) == 0 ||
strcasecmp(ua->argk[i], NT_("pools")) == 0) {
#undef VERSION
#define VERSION "2.5.23"
-#define BDATE "13 December 2008"
-#define LSMDATE "13Dec08"
+#define BDATE "14 December 2008"
+#define LSMDATE "14Dec08"
#define PROG_COPYRIGHT "Copyright (C) %d-2008 Free Software Foundation Europe e.V.\n"
#define BYEAR "2008" /* year for copyright messages in progs */