Backing up home directory, can I exclude ~/Library? I want to backup the home directory of my Mac. For reasons I won't go into, using builtin Mac backup tools is not an option and the backup cannot be too large. Luckily I already have my own software to do the backup, so the first point is taken care of. For the second point, I know that the data that is important would add up to about 5 GB, which acceptable.
When I took a look at my actual home directory however, it was way too big. It turned out that ~/Library alone takes about 50 GB.
What exactly is the purpose of this directory, and what sort of files are expected to be in it? What are the consequences of excluding it from the backup?
The Library folder contains all the preferences set for the applications you are using, login information for Mail etc, the local mail archive, your keychain and a lot of other configuration stuff. If you are using iCloud Drive it also contains the local copy of the drive content; and backups of your iDevices in case you don‘t use iCloud backup for them.
You may be able to recover most of it in case of data loss, but some things (e.g. your keychain or any locally stored mail) will be lost.
Given that external drives and USB sticks are rather cheap nowawdays it's most probably not worth the pain to fine-tune a backup script to include just the essentials from ~/Library.