Finder Empty Bin Fail: The Infinite Hardlinks Permobug
Recently, a situation has developed on my computer involving trash items that I can never delete. It's a permanent condition, hence why I made this elaborate video and blog about it. In the process I discovered a bug in Automator, namely that it can not help to automate emptying the trash! That is a fairly bad look considering these are apps at the core of the macOS: Finder and Automator.
A million folders that will not die now live forever in my Trashcan... 🥶
357 folders inside folders in my Trash!
So I wrote a script that would rsync (backup) an enormous folder with images (~6 GB of renders for AminoSee DNA Viewer) on my disk to another location on my disk (same disk, the internal PCIe storage on my MacBook).
I used the rsync with hard links, this would create two exact copies of the 6 GB folder:
I would then go and delete half the images from the website copy (so as not to upload them), but keep the full archive to make network syncs faster. Prior to this I was continuously deleting around 3 GB of images and then re-syncing them across a network, so to be more efficient, and cut back on network and disk thrashing, I keep a full copy local, and run the "sync and delete" locally with hard links.
This also cuts down on my laptop disk thrashing: I do still occasionally sync and blow away the very same 3 GB of images every few days, but to re-create is very fast if I am using this.
Recursive Folders Inside Folders
Prior to getting this setup perfect I made a botch by point rsync and telling it to copy the parent into the child infinitely. Finder can't clear it, and Automator can't automator the mouse clicks:
automator-cant-automate-trash-empty-and-macos-finder-infinite-hardlinks-permobug-HD
(Video embed only works in Safari, not Chrome or Firefox sorry!)
Posted by tomachi on September 15th, 2019 filed in Mac, Rants