SDCard cleanup script for for MacOS users

rrocha

Full Member
Mar 1, 2010
25
3
For all the mac users that need to run multiple commands in the terminal, sometimes forget to do so and have to take the card out again and reboot, yada, yada, yada... Here's a script to do everything for you.


Features:
- disable and remove Spotlight indexing
- remove dot files
- remove dot underbar files
- remove fsevents traces
- fixes flags on all sdcard directories except Nintendo and Emutendo dir (as it might mess up installation files and cause corruption on installed titles/tickets)
- optionally ejects the sdcard when finished


Installation:
Drop it in your favorite directory. I suggest /usr/local/bin as it will be in system path automatically


Usage:
After you finish all your operations in your card, run it either by double clicking or via terminal (prior to ejecting). First run will ask for your volume name. Your sdcard label, basically. After this, it will remember it and will be able to find it. If you need to reset this setting because you changed the label, either delete the .switch-eject.conf file that will be created in your HOME dir or run the script via terminal using the -c flag.
You can also use the -e flag via terminal for auto-eject when finished. If you want the script to always perform the auto-eject, change line 71 from [ ! -z "${e}" ] && echo "Ejecting ${VOL}" && sudo umount ${VOL} to echo "Ejecting ${VOL}" && sudo umount ${VOL}


Enjoy
 

Attachments

Last edited:
  • Like
Reactions: tokyo

mervyn

Noob Account
Dec 16, 2018
5
0
I've tried your script and it has broken all my backup games. I've been able to play some SNES emulators tho! No blaming, we're here to find a solution and I appreciate your effort. Not sure what has actually happened. I can't install any backup game now (gives me an error). Maybe I have to delete the whole Emutendo folder and start from scratch?
 
Last edited:

mervyn

Noob Account
Dec 16, 2018
5
0
I deleted Emutendo/Contents and now I can reinstall all my backup games. Not a big deal. Luckily, it seems I haven't lost any save game.

I've found a workaround, by the way. Hekate has a tool to clear archive bit files and stuff. What I'm doing is, every time I move files to the MicroSD with my Mac, I launch Hekate on my Switch, with the SX SO bootloader. I use its tool and right after that, I boot to the regular SX SO CFW. I'll try it a few more times and let you know.
 

mervyn

Noob Account
Dec 16, 2018
5
0
NOTE: I'm not sure if the issue is on @rrocha's script, or if it's just my Macbook. It just hasn't worked in my particular case.
 

rrocha

Full Member
Mar 1, 2010
25
3
Hi guys. Sorry for that. There was a bug affecting the Emutendo folder. I wasn't getting it because I was still on 2.2.1beta. Upgraded to 2.4 and 2.5 and I got it as well. Sorry for the mess up. Just Mervyn said, simply reinstalling the NSPs will fix the issue but it should be safer now for those on 2.3 and above as I tested it out myself multiple times today trying to forcefully corrupt my sdcard.

The new v1.3 is attached to the original post