Code of the Day
AdvancedAutomation

Lab: automate it

Practice automation decisions — scheduling, Makefiles, CI shell scripts, and debugging.

Lab · optionalBashAdvanced10 min
Recommended first
By the end of this lesson you will be able to:
  • Choose the right scheduling mechanism for a task
  • Structure a Makefile target correctly
  • Write a CI shell script that fails fast and loudly
  • Diagnose automation failures from symptoms

Optional scenario lab. Automation lives or dies on the small decisions: when to use cron vs. a queue, how to make a Makefile target idempotent, how to surface failures in CI. Practice them here.

Scenarios: automation

  1. 1.
    You need to run a cleanup script every night at 2 AM on a single server. Best tool?
  2. 2.
    Your Makefile has a clean target that deletes build artifacts. You also have a file named clean in the project root. What happens when you run make clean?
  3. 3.
    A CI shell script should use set -e so that the script exits immediately if any command fails.
  4. 4.
    A cron job ran last night but produced no output and the expected file wasn't created. First thing to check?
  5. 5.
    A deployment script that can safely be run twice without leaving the system in a broken state is called:

The automation mindset: make failures loud, make reruns safe, and always capture output — silent cron jobs are the hardest kind to debug.

Finished reading? Mark it complete to track your progress.