]> us-delaporte.pagekite.me Git - down-shift.git/commitdiff
Add wipe-down cmd
authorEdward Delaporte <edward@delaporte.us>
Tue, 16 Jun 2026 23:02:58 +0000 (18:02 -0500)
committerEdward Delaporte <edward@delaporte.us>
Tue, 16 Jun 2026 23:02:58 +0000 (18:02 -0500)
crontab.example [new file with mode: 0644]
down-shift [moved from downboy with 100% similarity]
wipe-down [new file with mode: 0755]

diff --git a/crontab.example b/crontab.example
new file mode 100644 (file)
index 0000000..4516889
--- /dev/null
@@ -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
similarity index 100%
rename from downboy
rename to down-shift
diff --git a/wipe-down b/wipe-down
new file mode 100755 (executable)
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