MAMP Might Break Your Time Machine Backups

Saturday, 05 April 2008

After many frustrating hours of trying to figure out why my Time Machine backups were failing (actually, they'd stall after being really close to finishing… they'd just sit there forever) I finally narrowed it down to one set of files: a local symfony project.

At first, I thought that perhaps something weird was happening with the symlinks that I use to link a Symfony's "/sf" directory to the Symfony library's web directory, but upon further investigation it boiled down to the Symfony cache files. I just happened to notice that for some reason the cache files were being generated with the user/group combination "mark/nogroup"… "mark" is my login name, so this seemed fine, but "nogroup" seemed a bit odd. After changing the group associated with these files to "staff" like the other files in the project, the Time Machine backup worked fine. So, apparently Time Machine somehow chokes on the "nogroup" group.

Now, I had just switched to using MAMP Pro instead of rolling my own Apache/PHP/MySQL because I wanted my setup to be completely portable from one machine to the next (with little effort), so I was a little bit disappointed with this, but there's an easy fix. Open up MAMP Pro and notice the "Run Apache/MySQL server as user" dropdown:


I had left this as the default which uses my username "mark/mark" but since there was no "mark" group, it was using "nogroup" and causing Time Machine to explode. So, I changed this to use "www/mysql" like so:


…and now the cache files are being generated with the "www/www" user/group combo and Time Machine backs up as it should.

Although this fix is not necessarily Symfony specific (it really has to do with any file that's written by the MAMP apache server process), it may save someone some trouble if they've got a similar Symfony set up going and they can't figure out why their Time Machine backup isn't working as advertised.

P.s. You can find files with a certain group by running this command in the terminal:

 find . -group nogroup

This will find any files in the current directory that belong to the "nogroup" group.