AutoSys date_conditions vs run_window: The 2 Rules Engineers Miss
- date_conditions: 0 = time scheduling OFF. Default. Catches people every time.
- date_conditions: 1 = time is an AND gate with conditions, not an OR gate.
- run_window for CMD jobs = advisory deadline + alarm, no kill — term_run_time kills.
- date_conditions is the master switch: 0 disables all time-based scheduling, 1 enables start_times, days_of_week, and run_calendar
- run_window defines the execution deadline: FW jobs stop detecting files outside it, CMD jobs keep running
- term_run_time kills long-running CMD jobs — run_window doesn't
- Midnight-spanning windows work natively: "22:00 — 06:00" means next day, no extra config
- Production failure: Missing run_window on FW jobs triggers on stale files at 3 AM, filling logs with false alerts
AutoSys Time Gate Debugging — 60-Second Diagnosis
No time-based execution
autorep -J JOBNAME -q | grep date_conditionsautorep -J JOBNAME -q | grep -E "start_times|run_calendar"File watcher misses files
autorep -J JOBNAME -q | grep run_window
date +%H:%Mls -la /path/to/watch_dir/*.datCMD job hangs past window
autorep -J JOBNAME -q | grep term_run_timeps -ef | grep process_nameProduction Incident
Production Debug GuideWhen jobs don't run when expected — the symptom-to-action map
Two attributes that beginners often misuse: date_conditions and run_window. They sound related but do different things.
date_conditions toggles whether time scheduling is even active. Set it to 0, and start_times is ignored entirely — only conditions or manual triggers run the job. Set it to 1, and your schedule kicks in.
run_window is a deadline, not a kill switch. For CMD jobs, AutoSys raises an alarm when the window closes but won't terminate the job unless you also set term_run_time. For File Watcher jobs, the window is strict — no file detection outside those hours. That difference trips up teams constantly.
date_conditions deep dive
date_conditions is binary — 0 or 1. When it's 0 (the default), the job has no time-based schedule. It only runs when explicitly triggered: manually via sendevent, or by a condition (another job's success/failure) evaluating to true.
When date_conditions is 1, the job has a time-based schedule AND can also have conditions. It runs when its time conditions are met AND its dependency conditions (if any) are all true.
Here's the piece that confuses people: setting date_conditions to 1 does NOT override conditions. The job still waits for its condition dependencies. The time schedule just adds another gate.
/* Job that ONLY runs via dependency (no time schedule) */ insert_job: downstream_job job_type: CMD command: /scripts/process.sh machine: server01 owner: batch date_conditions: 0 /* no time schedule */ condition: success(upstream_job) /* Job with BOTH a schedule AND a condition */ insert_job: morning_report job_type: CMD command: /scripts/report.sh machine: server01 owner: batch date_conditions: 1 /* time-based scheduling active */ days_of_week: mon-fri start_times: "07:00" condition: success(overnight_etl) /* also waits for ETL to complete */ /* To remove run_calendar and start_times from a job in JIL: */ update_job: morning_report date_conditions: 0 /* disables time scheduling entirely */
- date_conditions: 0 → Time = always true. Only conditions matter.
- date_conditions: 1 → Time = active gate. Must be true AND all conditions true.
- Neither setting makes conditions go away — they're always evaluated.
- If you want time OR conditions (not AND), you need two separate jobs with an OR dependency box.
run_window — the execution window
run_window defines the hours during which a job is permitted to run. It works differently depending on job type.
For CMD jobs: If the job starts and is still running when the window closes, AutoSys raises a max_run_alarm (if configured) but doesn't automatically kill it — term_run_time does that. The window is advisory: a polite suggestion, not a hard stop.
For File Watcher jobs: The watcher only looks for files during the run_window. Outside the window, it won't detect files even if they're present. This is the most important use of run_window — it's enforced, not advisory.
For Box jobs: run_window applies to the box itself. Jobs inside the box inherit the box's window only if they don't have their own run_window defined.
/* File Watcher: only detects files between 8 AM and 6 PM */ insert_job: watch_for_feed job_type: FW watch_file: /data/feeds/FEED_*.dat watch_interval: 30 min_file_size: 1024 machine: file-server owner: batch run_window: "08:00 - 18:00" /* CMD job: must complete within overnight batch window */ insert_job: nightly_reconcile job_type: CMD command: /scripts/reconcile.sh machine: finance-server owner: batch date_conditions: 1 days_of_week: all start_times: "23:00" run_window: "23:00 - 05:30" /* window for job execution */ term_run_time: 390 /* hard kill after 6.5 hours */
Midnight-spanning windows
run_window windows that span midnight (e.g., "22:00 - 06:00") work correctly in AutoSys — the end time next day is understood automatically. This is common for overnight batch windows.
No special syntax needed. Just write the start time and end time. AutoSys compares current time against the window logically: if start > end, the window crosses midnight.
/* Overnight batch window: 22:00 to 06:00 next day */ insert_job: overnight_batch job_type: BOX date_conditions: 1 days_of_week: mon-fri start_times: "22:00" run_window: "22:00 - 06:00" /* correctly handles midnight crossing */
| Attribute | What it does | Applies to job type | Kills the job? |
|---|---|---|---|
| date_conditions: 0 | No time schedule — condition/manual trigger only | CMD, BOX, FW | N/A |
| date_conditions: 1 | Enable start_times/days_of_week/run_calendar | CMD, BOX, FW | N/A |
| run_window | Hours during which job can run / FW can detect | CMD (advisory), FW (enforced) | CMD: No, FW: N/A |
| term_run_time | Hard-kill job after N minutes | CMD | Yes |
🎯 Key Takeaways
- date_conditions: 0 = time scheduling OFF. Default. Catches people every time.
- date_conditions: 1 = time is an AND gate with conditions, not an OR gate.
- run_window for CMD jobs = advisory deadline + alarm, no kill — term_run_time kills.
- run_window for FW jobs = enforced detection gate. Outside window = files invisible.
- Midnight windows: start > end means overnight. Swap them and your job runs all day.
- Always test time gates with autorep -q and a short test window before production.
⚠ Common Mistakes to Avoid
Interview Questions on This Topic
- QWhat is the difference between date_conditions and run_window in AutoSys?Mid-levelReveal
- QDoes run_window automatically kill a CMD job when the window closes?Mid-levelReveal
- QHow do you disable time-based scheduling on an existing AutoSys job?JuniorReveal
- QWhy is run_window important for File Watcher jobs specifically?SeniorReveal
- QHow do you set a run_window that spans midnight in AutoSys?JuniorReveal
- QWhat happens when a Box has a run_window and a child job has its own run_window?SeniorReveal
Frequently Asked Questions
What does date_conditions do in AutoSys?
date_conditions is a flag (0 or 1) that enables or disables time-based scheduling for a job. When set to 0 (the default), the job ignores start_times and days_of_week. When set to 1, the job runs according to its time schedule.
Does run_window kill a job when the window closes?
For CMD jobs, run_window doesn't automatically kill the job — it's advisory. You need term_run_time to hard-kill a job after a specified number of minutes. For File Watcher jobs, run_window prevents the watcher from detecting files outside the specified hours.
How do I disable time-based scheduling on an AutoSys job?
Use update_job to set date_conditions: 0. This disables start_times, days_of_week, and run_calendar. The job will only run when triggered by a condition or manually.
What is the difference between run_window and term_run_time?
run_window defines the hours during which a job is allowed to execute. term_run_time specifies the maximum number of minutes a job can run before AutoSys terminates it. For hard-killing hung jobs, use term_run_time.
Can run_window span midnight in AutoSys?
Yes. Run windows like "22:00 - 06:00" correctly span midnight. AutoSys understands that the end time is the following day. This is standard for overnight batch scheduling.
What happens if a File Watcher's run_window closes while it's scanning?
The scan completes if it started before the window closed. The watcher does not abort a scan in progress. However, once the scan finishes, no new scans begin until the next window opens. Files that arrive during the scan are detected in that scan; files that arrive after the scan but before the window closes are detected in the next watch_interval cycle.
Developer and founder of TheCodeForge. I built this site because I was tired of tutorials that explain what to type without explaining why it works. Every article here is written to make concepts actually click.