I goofed my Macbook real good. I moved some Time Machine backups from my external drive into Trash
and quickly realized that was a horrible mistake. I can't put them back and I can't delete them. So far I've been running rm
with a helper function called bypass
that is allowing me to skirt Apple's protection of deleting backups.
Anyways, I have a command
sudo /System/Library/Extensions/TMSafetyNet.kext/Contents/Helpers/bypass rm -rfv /Volumes/*/.Trashes
which for brevity can be referred to as
sudo bypass rm -rfv /Volumes/*/.Trashes
that keeps randomly getting interrupted by rm: fts_read: No such file or directory
. I think fts_read is essentially a UNIX kernel function that gets into filespace and is read as a file during very verbose recursive rm
calls. So I want to catch fts_read
and restart my sudo bypass rm -rfv /Volumes/*/.Trashes
. I don't know bash that well, but here's some pseudocode of my thoughts:
try:
sudo bypass rm -rfv /Volumes/*/.Trashes
except 'rm: fts_read: No such file or directory':
sudo bypass rm -rfv /Volumes/*/.Trashes
Basically right now I'm manually restarting the command every time I get the error, but this process is taking dozens of hours so it'd be nice if it could restart itself.