Automation project
Automate a weekly report with safe scripting and logging.
What you will be able to do
- Log every run with a timestamp.
- Fail loudly and exit non-zero.
- Write output atomically.
- Schedule with cron or a systemd timer.
In plain English
The capstone combines navigation, text processing, pipes, scripts and cron. Write a script that reads a data file, produces a summary, writes a log and exits non-zero on failure. Schedule it and verify the result.
#!/usr/bin/env bash
set -euo pipefail
log="report-$(date +%F).log"
{
echo "run: $(date -Is)"
awk -F, '{ total += $2 } END { print "total minutes:", total }' minutes.csv
} | tee "$log"Your turn
EasyLog with a timestamp
Write a line starting with the ISO timestamp to report.log.
BASH · starter
echo "done"Check your understanding before moving on.
Knowledge checkQuestion 1
Why use absolute paths in cron scripts?
Select an answer to continue
Study tools
Make it yours.
Keep a private note for this lesson, then turn the key ideas into flashcards you can revisit.
Sign in to save notes and flashcards.Both are private to your account and stay with your progress.
Sign inFinished reading?
Lock in what you just learned.
0%
Mark this lesson complete to save your place and move one step closer to the certificate.