Slimming down near 200GB ~/Library
After years of moving the same home directory from one version of macOS to the next, ~/Library
is becoming a big burden on Time Machine.
~/ > du -s ~/Library/* | sort -nr | head
180487496 /Users/john/Library/Application Support
135081688 /Users/john/Library/Containers
40345344 /Users/john/Library/Developer
26491896 /Users/john/Library/Group Containers
13159040 /Users/john/Library/Caches
3349072 /Users/john/Library/iTunes
1763968 /Users/john/Library/Mobile Documents
1142016 /Users/john/Library/Safari
286608 /Users/john/Library/Messages
233128 /Users/john/Library/Internet Plug-Ins
Can you suggest a good way to slim ~/Library
down?
Can you suggest a good way to slim ~/Library down?
This is tough to answer because it's a very simple answer, but a very complex and/or tedious process to achieve what you want to do.
Simple Answer
Just delete the files you're not using. If you don't need it, get rid of it.
More Complex
After years of moving the same home directory from one version of macOS to the next...
This where the problem stems from - simply copying the home folder from one Mac to the next or even between upgrades means that all of the support files, including from programs you no longer use or even have, are taking up space.
This is why I don't suggest copying over the entire home folder, but rather only the user data like your documents, pictures, etc. from the home folder when migrating to a new computer (or even when upgrading). I personally always like to start with a clean slate so-to-speak and I spend some time migrating only what is necessary.
Some Tips...
Technically speaking, you could delete all of it and most will get recreated with only the latest data as you use the Apps. That, however, will cause you to lose preferences. This is why I like to backup all of my preference files before embarking on an upgrade or migration.
-
Backup Your Preferences for Your Important Apps. Using Firefox as an example, find out where the preference files are located and back those up individually. Then, when you move to your new system, simply copy them back to the default location.
-
Selectively Migrate. Also, don't migrate everything all at once. Instead, keep your original Time Machine backup for about 1 month or so after you've created your new account on you new machine and as you install or use programs for the first time, copy the settings from the Time Machine backup as you need them. This way, you're only migrating what you actually use, not migrating files from the App you stopped using years ago.
-
Make use of the cloud for data. I prefer OneDrive over iCloud for syncing my data (mostly because it's cross platform compatibility), but more importantly, it has it's own folder within my
$HOME
directory, not a folder buried deep within$HOME/Library/Application Support
. I symlinkDocuments
,Pictures
, etc. to theOneDrive
directory so from a Finder perspective everything looks standard, but everything I have is actually synced to the cloud. If I move to a new machine, once I sync OneDrive, everything (current) is pulled down from the cloud; no migration necessary. -
Keep separate copies of shell customization, scripts, ssh keys, etc. on a different volume. Over the years, I'm sure you have made a number of tweaks to your shell profile including environment variables, your prompt or even custom functions. Keep these seperate so that when you migrate/move you can easily copy them over. You can use a (removable) flash disk or a network share, or even a folder in the cloud. (backed up, of course). Doing it this way also makes it very easy to share with others or use it on another platform (I do this a lot with my FreeBSD boxes).
-
Pictures, Music, etc. These files will take up tons of space. What I do here is get a USB disk (I'm using flash now because it's so inexpensive) to individually back up those files. Instead of including it on my regular Time Machine backup, I have a separate job for backing up Pictures and Music onto physical media. Technically, I personally backup to a NAS that backs up to the flash disks, but a NAS isn't required. A simple USB hub (USB3 and powered is ideal) with some flash sticks that you don't remove makes an excellent backup location.
These strategies have worked well for me over the years. However, in your pradicament, I would suggest to just "bite the bullet" and start with a clean user profile and manually migrate as you need it. It will take some time, but you don't need to do it all at once - do it as needed. Then. when you get ready for your next upgrade/migration, it will be much easier and much faster.