Dave Slusher

3 minute read

This is not directly ServiceNow related, but a tip I stumbled across that has made my digital and work life much easier.

It’s highly common that people have a “Downloads” directory that they choose not to back up. Why would you? It has big files that churn a lot, so that is just extra cruft in your Time Machine or other backup. However, unless you are very disciplined over time you get unruly chaos. It is a mix of files of no persistent value, things you do actually want to keep and maybe the only copy of something important. It makes life a mess and worse, it makes transitioning to a new machine a problem when it should be plug-and-play.

Enter the “Transient” directory. I left my Downloads directory alone and created a new directory. I configured everything to use this new directory for downloaded files - Chrome, Safari, Outlook, Slack. Anything that pulls down a file uses this directory. That’s Step One.

Step Two is setting up the following cron jobs:

46 */6 * * *  find /Users/dave.slusher/Transient/ -maxdepth 20 -type f -mtime +14d -exec rm {} \;
46 */6 * * *  find /Users/dave.slusher/Transient/ -maxdepth 20 -type d -mtime +14d -exec rmdir {} \;
46 */6 * * *  find /Users/dave.slusher/Transient/ -maxdepth 20 -type d -iname ".*"   -mtime +14d -exec rmdir {} \;

What these jobs do is run every 6 hours (at a weird time, not at the top of the hour) and look for files and directories that have been written over 14 days ago. Thus, passively and with no thought on my part, old files will disappear. Directories get pruned slowly because first the files go, then the empty directories most deeply nested but eventually they all go away.

The beauty of this system is that it now enforces that discipline that no one has. When you download files, they will automatically go away. If you care about it, move it to a permanent home or else you will lose them. Since creating this system, I’ve probably only lost a file or three that I actually cared about. The first time something deletes out from under you, you learn to move them quickly or else resign yourself to deletion. All the installer files, the PDFs that I downloaded because I cared about one single technical command on how to fix something, etc etc - all of these files are gone.

It has changed me from a digital hoarder to someone mindful about what I bring onto the machine. At the point of download I decide if it has persistent value and if so, I give it that. Otherwise, I accept it is a temporary file and will move on through.

In a way, it’s not unlike what we advocate in handling of the Personal Developer Instances. If the work (or files) is valuable to you, treat it with value . By default, if you don’t then expect that it will disappear. Knowing which is which is important.


Comments