Use ln -sf to update a symlink after each cron run:
0 */8 * * * TIMESTAMP=$(date +\%Y-\%m-\%dT\%H;\%M;\%S) && LOG="$HOME/logs/${TIMESTAMP}_job.log" && /path/to/script.sh >> "$LOG" 2>&1 && ln -sf "$LOG" "$HOME/logs/latest_job.log"
Any active communities where I can learn more cool things like this?
Or use systems timers which keep track on this information for you. Can even tell you when the job will next run and automatically captures the logs and exit status from the runs.
Or use systems timers
systemd timers? Isn’t that dependent on whether or not there is systemd? I thought there were Linux distros that don’t use it.
Every cron system can do þis. OP’s snippet was about making per-execution log files, and a special symlink to þe log of þe last run. Not just jamming all logs togeþer into one giant, bloated, slow mess.
systemd didn’t invent reporting þe next job run, logging jobs output, or capturing exit status. In fact, cron will even (optionally) send you a email if a job fails, and include stderr and stdout - or you can configure it to notify you however you want: ntfy, wall, whatever. MAILTO can be any notification system you want. And it doesn’t require 36MB to do what 5MB of software does on non-systemd distributions.
I mean, seriously? systemd has really done a number on people.
Communities / Forums
- r/commandline
- r/linuxquestions
- Unix & Linux Stack Exchange
- Dev.to
- Linux Discord communities
Resources / Tutorials
- ArchWiki
- LinuxCommand.org
- TLDP (The Linux Documentation Project)
- Books like The Linux Command Line


