From a8b84206ad6324063782a17aab5b0e76f733f0c9 Mon Sep 17 00:00:00 2001 From: Edward Delaporte Date: Tue, 16 Jun 2026 18:02:58 -0500 Subject: [PATCH] Add wipe-down cmd --- crontab.example | 2 ++ downboy => down-shift | 0 wipe-down | 11 +++++++++++ 3 files changed, 13 insertions(+) create mode 100644 crontab.example rename downboy => down-shift (100%) create mode 100755 wipe-down 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 -- 2.47.3