DevOps Peach

Challenge · Medium

Rotten Rotation

The nightly log rotation script skips some logs, deletes the wrong archives and still reports success. Fix the script, not the logs.

shell scriptquotingloopsexit codes

Practises the module Bash Scripting.

The ticket

TICKET OPS-2377: rotate-logs is lying

Cron runs rotate-logs /var/log/shop 3 every night. Ops noticed three things: one log is never rotated, the newest archives keep disappearing, and when someone forgot the arguments the script still exited with status 0.

Start the challenge →