From: Edward Delaporte Date: Tue, 16 Jun 2026 23:02:58 +0000 (-0500) Subject: Add wipe-down cmd X-Git-Url: https://us-delaporte.pagekite.me/gitweb/down-shift.git/commitdiff_plain/a8b84206ad6324063782a17aab5b0e76f733f0c9?ds=sidebyside Add wipe-down cmd --- diff --git a/crontab.example b/crontab.example new file mode 100644 index 0000000..4516889 --- /dev/null +++ b/crontab.example @@ -0,0 +1,2 @@ +0 20 * * * down-shift # Move 30 day old Downloads into archive folder +0 21 * * * wipe-down # Move 60 day old Downloads into /tmp diff --git a/downboy b/down-shift similarity index 100% rename from downboy rename to down-shift diff --git a/wipe-down b/wipe-down new file mode 100755 index 0000000..07d4291 --- /dev/null +++ b/wipe-down @@ -0,0 +1,11 @@ +#!/usr/bin/bash +# wipe-down cleans up old files +DOWNLOADS="$HOME/Downloads" + +# Move anything older than 60 days to ~/Downloads/trash +trashdir="/tmp/trashed_from_downloads" +mkdir -p $trashdir +find "$DOWNLOADS" -maxdepth 2 -type f -mtime +60 -exec mv -f {} $trashdir \; + +# Delete any empty folders +find "$DOWNLOADS" -empty -type d -delete