AITeky Learn

AiTeky Original Interactive Learning & Practice Intermediate

Shell and PowerShell scheduled jobs: overlap, locks and the import that ran twice at once

See how a scheduled job that takes longer than its interval starts a second copy on top of the first, how a lock stops that without causing a permanent jam when a job crashes, and fix a nightly import that doubled its data.

A scheduled job (cron on Linux, Task Scheduler on Windows) starts a script at fixed times. It does not check whether the previous run has finished. If a run takes longer than the gap between starts, two copies run at once, and two copies of a script that writes files or database rows can corrupt each other's work.

This course models schedules, overlaps and locks with small Python programs you can run in your browser. Python stands in for shell scripts: the code is not a shell script, but the timeline arithmetic and the lock behaviour it shows are what happens on a server. Check your scheduler's documentation for overlap settings, and your shell's for flock or mutex handling. All numbers are made up.

  • Learn lessons explain one idea at a time and let you run it.
  • Industry ready lessons decide and justify, and end with interview questions.

No shell experience is assumed. Basic Python helps.

Locked. Sign up free

Learn

Understand each idea with everyday examples. No coding background needed.

  1. 01 25 min Free sample 🔒 AiTeky Pass When a run outlasts its slot Lay out a day of hourly job runs on a timeline, find the runs that overlap when one is slow, and see how a lock turns an overlap into a skipped run.
  2. 02 25 min 🔒 AiTeky Pass A lock that cannot get stuck Take a lock in one atomic step, see how a crashed job leaves the lock held for ever, and add an age limit so a stale lock is taken over.

Industry ready

Real problems from real jobs, and the questions interviewers ask about them.

  1. 03 30 min 🔒 AiTeky Pass On the job: the import that ran twice at once A nightly import overlapped with itself and doubled its rows. Count the damage, compare four fixes by effort and risk, choose, and write the note.

We use essential cookies to run the site. With your permission we also set one anonymous ID to count unique visitors, and analytics cookies to see which pages help learners. Cookie notice

Join AiTeky Learn. It's free.

Create a free account to track your progress, save items for later and get study suggestions.

Sign up free Log in