summaryrefslogtreecommitdiff
path: root/dotfiles/common/.local/bin/cron/log-cleanup
blob: 651982c23cbc1e12211359d5851a8920c1eaaca3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/sh

# Deletes log files older than 7 days from ~/.local/var/log
# Services (hyprland, waybar, dunst, hypridle, gammastep) create a new
# timestamped log file per session. Without cleanup these accumulate.
#
# Intended to run daily via crontab.

LOG_DIR="$HOME/.local/var/log"

if [ -d "$LOG_DIR" ]; then
    find "$LOG_DIR" -name "*.log" -mtime +7 -delete
fi