2 ===================================================================
3 --- src/dird/job.c (révision 4696)
4 +++ src/dird/job.c (copie de travail)
6 static void job_monitor_destructor(watchdog_t *self);
7 static bool job_check_maxwaittime(JCR *control_jcr, JCR *jcr);
8 static bool job_check_maxruntime(JCR *control_jcr, JCR *jcr);
9 +static bool job_check_maxschedruntime(JCR *control_jcr, JCR *jcr);
11 /* Imported subroutines */
12 extern void term_scheduler();
14 set_jcr_job_status(jcr, JS_Canceled);
15 Jmsg(jcr, M_FATAL, 0, _("Max run time exceeded. Job canceled.\n"));
18 + /* check MaxSchedRunTime */
19 + } else if (job_check_maxschedruntime(control_jcr, jcr)) {
20 + set_jcr_job_status(jcr, JS_Canceled);
21 + Jmsg(jcr, M_FATAL, 0, _("Max sched run time exceeded. Job canceled.\n"));
25 Dmsg3(800, "Cancelling JCR %p jobid %d (%s)\n", jcr, jcr->JobId, jcr->Job);
30 + * Check if MaxSchedRunTime has expired and if the job can be
33 +static bool job_check_maxschedruntime(JCR *control_jcr, JCR *jcr)
35 + if (jcr->job->MaxSchedRunTime == 0 || job_canceled(jcr)) {
38 + if ((watchdog_time - jcr->sched_time) < jcr->job->MaxSchedRunTime) {
39 + Dmsg3(200, "Job %p (%s) with MaxSchedRunTime %d not expired\n",
40 + jcr, jcr->Job, jcr->job->MaxSchedRunTime);
48 * Get or create a Pool record with the given name.
51 Index: src/dird/dird_conf.c
52 ===================================================================
53 --- src/dird/dird_conf.c (révision 4696)
54 +++ src/dird/dird_conf.c (copie de travail)
56 {"writebootstrap",store_dir, ITEM(res_job.WriteBootstrap), 0, 0, 0},
57 {"writeverifylist",store_dir, ITEM(res_job.WriteVerifyList), 0, 0, 0},
58 {"replace", store_replace, ITEM(res_job.replace), 0, ITEM_DEFAULT, REPLACE_ALWAYS},
59 + {"maxschedruntime", store_time, ITEM(res_job.MaxSchedRunTime), 0, 0, 0},
60 {"maxruntime", store_time, ITEM(res_job.MaxRunTime), 0, 0, 0},
61 {"fullmaxwaittime", store_time, ITEM(res_job.FullMaxWaitTime), 0, 0, 0},
62 {"incrementalmaxwaittime", store_time, ITEM(res_job.IncMaxWaitTime), 0, 0, 0},
63 Index: src/dird/dird_conf.h
64 ===================================================================
65 --- src/dird/dird_conf.h (révision 4696)
66 +++ src/dird/dird_conf.h (copie de travail)
68 char *WriteVerifyList; /* List of changed files */
70 int replace; /* How (overwrite, ..) */
71 + utime_t MaxSchedRunTime; /* max run time in seconds from Scheduled time*/
72 utime_t MaxRunTime; /* max run time in seconds */
73 utime_t MaxWaitTime; /* max blocking time in seconds */
74 utime_t FullMaxWaitTime; /* Max Full job wait time */