You're offline — showing cached data

log-rotate

log-rotate
2026-06-13 06:09:56 SAST
← Back to Tasks

OVERRIDES runtime profile: uses direct_python (plain Python, no model) because the script is a stdlib-only file rotator — it never invokes the claude CLI or any LLM API, so the scheduler must not inject a provider env.

Daily gzip rotation of oversized workspace logs. Copytruncate semantics: the live file is gzip-copied to <name>.log.1.gz and then os.truncate()d in place, so long-running writers (scheduler systemd unit, tmux pipe-pane, cron >> redirects — all O_APPEND, verified via /proc fdinfo) keep writing into the truncated file without restart. Retention: .1.gz (newest) through .4.gz (oldest); the oldest archive is dropped on each rotation.

Manual run / dry-run:

python3 ~/workspace/scripts/rotate_logs.py --dry-run
python3 ~/workspace/scripts/rotate_logs.py --size-mb 20 --keep 4
Daily at 04:4040 4 * * *
Yes
script
300s
No
in 23h (2026-06-14 04:40)

Task Definition

tasks/log-rotate.md
script
set
No
No
python3 ~/workspace/scripts/rotate_logs.py

Edit Schedule

Result:
3
Runs (7d)
3
Completed
0
Failed
0
Timeout
100%
Success (7d)
1s
Avg Duration
infrastructure logs cleanup

Run History (3)

StartedFinishedStatusDurationOutputLog
1h ago 1h ago completed 0s
nothing to rotate in /home/lucienne/workspace/logs (threshold 20MB, keep 4)
View log
1d ago 1d ago completed 0s
nothing to rotate in /home/lucienne/workspace/logs (threshold 20MB, keep 4)
View log
2d ago 2d ago completed 3s
rotated persistent-luci.tmux.log (68.4MB) -> persistent-luci.tmux.log.1.gz (5.3MB), truncated in place
View log

Comments (0)

No comments yet — add instructions for Luci
Help