]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix JobLevel for UA started Admin jobs; add -v to startup scripts
authorKern Sibbald <kern@sibbald.com>
Tue, 22 Apr 2003 10:10:44 +0000 (10:10 +0000)
committerKern Sibbald <kern@sibbald.com>
Tue, 22 Apr 2003 10:10:44 +0000 (10:10 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@454 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/scripts/bacula.in
bacula/src/cats/sql_create.c
bacula/src/dird/job.c
bacula/src/dird/ua_run.c
bacula/src/lib/jcr.c

index dbbed1203c9bdfd25e9405e151562c446a695ee8..f530ba66a376804064e08d6688111b240ddbeb85 100755 (executable)
@@ -166,12 +166,12 @@ failure() {
 case "$1" in
     start)
        echo "Starting the Storage daemon"
-       @sbindir@/bacula-sd $2 -c @sysconfdir@/bacula-sd.conf
+       @sbindir@/bacula-sd $2 -v -c @sysconfdir@/bacula-sd.conf
        echo "Starting the File daemon"
-       @sbindir@/bacula-fd $2 -c @sysconfdir@/bacula-fd.conf
+       @sbindir@/bacula-fd $2 -v -c @sysconfdir@/bacula-fd.conf
        sleep 2
        echo "Starting the Director daemon"
-       @sbindir@/bacula-dir $2 -c @sysconfdir@/bacula-dir.conf
+       @sbindir@/bacula-dir $2 -v -c @sysconfdir@/bacula-dir.conf
        ;;
     stop)
        echo "Stopping the File daemon"
index 9c693e1c01ba2c5698b98f07eae35fe8c0706364..2d78d31c361a4bad52473c0a6c1238c35d96321f 100644 (file)
@@ -73,6 +73,7 @@ db_create_job_record(void *jcr, B_DB *mdb, JOB_DBR *jr)
    char ed1[30];
 
    stime = jr->SchedTime;
+   ASSERT(stime != 0);
 
    localtime_r(&stime, &tm); 
    strftime(dt, sizeof(dt), "%Y-%m-%d %T", &tm);
index a1339242f1ec33e19d0beb5d0cdfaae393f1af2a..d5481b5e96750ac44a432e380d648c7545a26822 100644 (file)
@@ -99,6 +99,7 @@ void run_job(JCR *jcr)
    sm_check(__FILE__, __LINE__, True);
    init_msg(jcr, jcr->messages);
    create_unique_job_name(jcr, jcr->job->hdr.name);
+   set_jcr_job_status(jcr, JS_Created);
    jcr->jr.SchedTime = jcr->sched_time;
    jcr->jr.StartTime = jcr->start_time;
    jcr->jr.Type = jcr->JobType;
@@ -271,6 +272,10 @@ static int acquire_resource_locks(JCR *jcr)
    time_t now = time(NULL);
 
    /* Wait until scheduled time arrives */
+   if (jcr->sched_time > now && verbose) {
+      Jmsg(jcr, M_INFO, 0, _("Waiting %d seconds for sched time.\n"), 
+          jcr->sched_time - now);
+   }
    while (jcr->sched_time > now) {
       Dmsg2(100, "Waiting on sched time, jobid=%d secs=%d\n", jcr->JobId,
            jcr->sched_time - now);
index 02931374216d7956b75f576285240ce5cd8889f5..043932664270bd06f46013ae6384392a41d0fef6 100644 (file)
@@ -350,6 +350,7 @@ When:     %s\n"),
                 NPRT(jcr->client->hdr.name),
                 NPRT(jcr->store->hdr.name), 
                 bstrutime(dt, sizeof(dt), jcr->sched_time));
+        jcr->JobLevel = L_FULL;
         break;
       case JT_BACKUP:
       case JT_VERIFY:
@@ -399,7 +400,7 @@ When:     %s\n"),
               jcr->RestoreJobId = atoi(ua->cmd);
            }
         }
-         jcr->JobLevel = 'F';         /* default level */
+        jcr->JobLevel = L_FULL;      /* default level */
          Dmsg1(20, "JobId to restore=%d\n", jcr->RestoreJobId);
          bsendmsg(ua, _("Run Restore job\n\
 JobName:    %s\n\
index ee0c5040505c13518bdea2f150cfd3a9b98176cb..69f46c36cb1c7706394753aef705a89c7a02d8f6 100755 (executable)
@@ -47,7 +47,7 @@ JCR *new_jcr(int size, JCR_free_HANDLER *daemon_free_jcr)
    JCR *jcr;
 
    Dmsg0(200, "Enter new_jcr\n");
-   jcr = (JCR *) malloc(size);
+   jcr = (JCR *)malloc(size);
    memset(jcr, 0, size);
    jcr->my_thread_id = pthread_self();
    jcr->sched_time = time(NULL);