diff options
Diffstat (limited to 'dotfiles/common/.local')
| -rwxr-xr-x | dotfiles/common/.local/bin/cron/log-cleanup | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/dotfiles/common/.local/bin/cron/log-cleanup b/dotfiles/common/.local/bin/cron/log-cleanup new file mode 100755 index 0000000..651982c --- /dev/null +++ b/dotfiles/common/.local/bin/cron/log-cleanup @@ -0,0 +1,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 |
