Cron Job Automation

🧪 Cron Job Automation Lab 📌 Objective To build a scheduled automation script, observe its behavior, and learn how to debug failures. ⚙️ Part 1 - Script Setup Create a working directory: mkdir -p ~/cronlab cd ~/cronlab Create the script: nano backup.sh #!/bin/bash DATE=$(date +"%Y-%m-%d_%H-%M-%S") LOG_FILE="$HOME/cronlab/backup.log" SOURCE="$HOME" BACKUP_DIR="$HOME/cronlab/backups" exec >> "$LOG_FILE" 2>&1 echo "--- RUN $DATE ---" mkdir -p "$BACKUP_DIR" rsync -a --exclude="cronlab" \ "$SOURCE/" "$BACKUP_DIR/home-backup-$DATE/" echo "Backup finished" ...

April 17, 2026 · 2 min

Systemd Restart Behavior: Why Restart=on-failure Didn't Work

🧪 Systemd Service Restart Behavior Lab 📌 Objective To test and understand how systemd handles automatic service restarts using the Restart=on-failure policy. ⚙️ Environment OS: Ubuntu (systemd-based) Tools: systemctl, journalctl, bash 🛠️ Setup 1. Create a test script sudo nano /usr/local/bin/labtest.sh #!/bin/bash while true; do echo "lab service is alive: $(date)" sleep 10 done Make it executable: sudo chmod +x /usr/local/bin/labtest.sh 2. Create a system service sudo nano /etc/systemd/system/labtest.service [Unit] Description=Lab test service After=network.target [Service] ExecStart=/usr/local/bin/labtest.sh Restart=on-failure StandardOutput=journal [Install] WantedBy=multi-user.target Step 3 — Start the service sudo systemctl daemon-reload sudo systemctl enable labtest sudo systemctl start labtest systemctl status labtest ...

April 14, 2026 · 2 min

Grub2 Boot Recovery: Restoring a Server at 2AM

A step-by-step account of recovering a production server that dropped into the GRUB2 rescue shell at 2AM, resolved within SLA.

April 9, 2026 · 2 min

How I set up my IT journal

Why I started this blog I am a beginner in IT and I want to document every problem I solve as I learn What I plan to write about Linux & Windows Troubleshooting Network issues Tools I discover

April 9, 2026 · 1 min