From 88a6ebc40f4269db0c6f40cf3189f9d2639dc714 Mon Sep 17 00:00:00 2001 From: Felix Nehrke Date: Fri, 3 Jan 2025 15:48:36 +0100 Subject: [PATCH] Cleanup downloads directory regularly from old files (more than 1 day) --- .bashrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.bashrc b/.bashrc index 5120df7..355c2f0 100644 --- a/.bashrc +++ b/.bashrc @@ -7,6 +7,9 @@ export BASH_SILENCE_DEPRECATION_WARNING=1 # TODO: get rid of it by applying all relevant things in this file [ -d /etc/skel/.bashrc ] && . /etc/skel/.bashrc +# ensure to delete files from ~/Downloads after 1 day +(crontab -l 2>/dev/null; echo "*/5 * * * * /usr/bin/find $HOME/Downloads/ -type f -mtime +1 -exec /usr/bin/rm {} \;") | sort -u | crontab - + # autocompletion [ -s /usr/share/bash-completion/completions/git ] && . /usr/share/bash-completion/completions/git which brew &>/dev/null && [ -s $(brew --prefix)/etc/bash_completion ] && . $(brew --prefix)/etc/bash_completion