2

My MacBook Pro (10.15.7) is backing up parts of the drive I didn't expect. I have been cleaning up and excluding directories, but this time I found something I thought was excluded by default: private/var/folders.

To examine I have been using 'Timedog'. Here is a piece of today's output: Timedogoutput1

Again, as far as I know and as referenced here, the standard exclusions

/System/Library/CoreServices/backupd.bundle/Contents/Resources/StdExclusions.plist

include ('exclude') private/var/folders/ under the "contents excluded" category, meaning that the folder container is backed up but nothing inside. Clearly here we have 42.6 MiB of content.

  • 1
    The StdExclusions file doesn't exist in macOS 11 - not at that location. Does it exist in Catalina? Anyway, if I look in the Time Machine volumes, the .exclusions.plist (in the root of each backup) does include /private/var/folders as excluded. But a subset of the content is in my TM backups - a few tens of MB. Hmm! – Gilby Feb 23 '21 at 06:26
  • 1
    Can it be possible the /private/var/folders data was already there? When was it created? – CousinCocaine Feb 25 '21 at 08:07
  • @CousinCocaine what are you implying? Do backups of excluded items continue if they were ever backed up? – Richard Birkett Feb 25 '21 at 17:08
  • @RichardBirkett, what I meant was that the files were put there once (first backup run?), and thereafter never touched again. Thats why I was curious when the files where created or last touched. – CousinCocaine Feb 27 '21 at 16:10

1 Answers1

3

This is an attempt at a (partial) answer. It is too long for a comment.

Apple makes changes (mostly minor) to Time Machine without notification or documentation. I believe that the question and answers here are too old to be reliable for recent versions of macOS.

The StdExclusions.plist does not exist inside the backupd.bundle on macOS 11, so that is no longer a mechanism for exclusion. I don't know if it exists in macOS 10.15.7. And even if it does exist, whether it is used.

Mike Bombich of Carbon Copy Cloner specifies what is excluded by CCC and says that it excludes only part of /private/var/folders. He lists these as being excluded:

  • /private/var/folders/*/*/C
  • /private/var/folders/*/*/T

Of course, that doesn't directly imply that Time Machine is doing the same, but it is a pointer.

On my Mac some files are from /private/var/folders are included in Time Machine. My Time Machine snapshots include just these:

  • /private/var/folders/*/*/0/...

This is all largely circumstantial regarding Time Machine, but does suggest that the exclusion mechanism is more complex (or should I say hidden) than most of us expect.

Just to muddy the waters, I have to admit that the exclusions.plist file included in the root of every Time Machine (macOS 11.2) snapshot does list /private/var/folders as being excluded!

Finally, my advice is never to attempt a cleanup of system exclusions if there is any likelihood of wanting to do a full restore.

Gilby
  • 10,852
  • Yes I observed the stdexclusions in the bundle on my OS. What I'm hearing is that in OS 11 they have rejigged the system, but I won't be upgrading until I understand this. So you agree the contents of /private/var/folders/ should be excluded? This makes me feel not much closer to an answer for now. I'm fine not doing a full restore to be honest. It's been way too long since I cleaned house and let my OS breathe a little. – Richard Birkett Feb 25 '21 at 17:03
  • Also, just confirm for me that there is absolutely no reason to backup this stuff? I've seen threads on SE about trashing the contents (but not the folder!) as a cleanup and that's ok. Has this changed? – Richard Birkett Feb 25 '21 at 17:10
  • 1
    @RichardBirkett TM is designed to enable a full recovery and if that were your aim then don't mess with the system settings. But if you are fine with disaster recovery by doing a clean install then you can remove most system folders - certainly /private/var/folders and much more (including /Applications?) and just keep your personal files and licences. The interesting question then is what to backup from ~/Library. And on macOS 11, TM seems to be more solid (though I have not done a full restore test) and faster. – Gilby Feb 25 '21 at 22:27
  • 1
    As an aside, I use BackupLoupe to discover what has been backed up by TM. – Gilby Feb 25 '21 at 22:30
  • What the heck is in private/var/folders/ that's so worth restoring? I honestly thought it was a load of temporary files made on each boot (hence why always changing). If you delete the contents they just regenerate right? – Richard Birkett Feb 26 '21 at 04:38
  • In my backups, I can see files in /private/var/folders relating to various Apple services (in particular Launch Services). I guess that allows recovery of their state. But, as I said, if you don't care about full recovery then exclude as much as you want. They will be recreated with a clean install if that is your recovery method. – Gilby Feb 26 '21 at 07:04
  • Ok so final question then: if I excluded /private/var/folders/ myself, and did a full recovery, would the computer function normally? I am ok with an inconvenience like losing open applications and Safari tabs. – Richard Birkett Feb 26 '21 at 18:13
  • I don't know exactly what would work and what wouldn't. From the content of files in the backup, I would expect some loss of settings relating to Apple services as a minimum. But I am confident the computer would function. You will have to try it yourself. Any non-standard backup and recovery needs to be tested. – Gilby Feb 26 '21 at 22:30