Skip to main content

Exclude my ‘do not back up’ folder from auto-deleting

ID
327dddd
date
2022-06-03 16:22:00+00:00
author
Alex Chan <alex@alexwlchan.net>
parent
4ffdb03
message
Exclude my 'do not back up' folder from auto-deleting
changed files
1 file, 6 additions

Changed files

emptydir (724) → emptydir (998)

diff --git a/emptydir b/emptydir
index a998174..7119660 100755
--- a/emptydir
+++ b/emptydir
@@ -11,6 +11,12 @@ import shutil
 
 
 def can_be_deleted(d):
+    # This is a folder where I put files that I explicitly don't
+    # want to put in backups.  See https://overcast.fm/+R7DX9_W-Y/21:22
+    # or my Obsidian note about the same.
+    if os.path.abspath(d) == "/Users/alexwlchan/Desktop/do not back up":
+        return False
+
     entries = os.listdir(d)
     return entries == [".DS_Store"] or not entries