8

I work with a number of OSX client machines that back up via TimeMachine to AFP shares on an Ubuntu Linux file server, exported by netatalk/afpd. These clients back up at arbitrary times of the day, every day. There are other important non-TimeMachine AFP shares on the server also.

On the server, the TimeMachine backups are represented as sparsebundles - a data storage format involving many 'bands' - stored on the standard EXT4 filesystem. Buried within this sparsebundle is a disk image with the HFS+ filesystem that TimeMachine uses, but from the server side it is just a collection of band files and some top-level metadata.

rsnapshot runs every 4 hours on the server and backs up the sparsebundle band files & metadata onto removable media (for off-site storage). Therefore rsnapshot is also backing up these sparsebundle bands at arbitrary times of the day. rsnapshot uses rsync to perform the copying.

The problem is that if rsnapshot runs while a client machine has its sparsebundle mounted, I am concerned that it is possible for rsnapshot to capture an inconsistent state of the sparsebundle because the bands may change during the backup process. Clearly this is not conducive to guaranteeing a restorable backup!

I'm trying to think of ways to work around this problem. It seems important that the sparsebundle is not mounted at the time rsnapshot tries to do the backup. From the server side, the only way I can presently see to do this is to take down the aftp daemon, perhaps after waiting for the sparsebundle to be unmounted by the OSX client. The downside of this is that it also takes the other non-TimeMachine AFP exports offline also, and this is unacceptable to the users. As far as I can tell, afpd doesn't provide a way to (easily) add or remove exports - although one option may be some automated rewriting of afpd's config files to disable the TM exports during the rsnapshot backup, but this still takes down the AFP shares for a short time.

Is there a better way?

davidA
  • 353
  • 2
  • 11
  • Did you ever find an adequate solution? I'm facing the same question now... – chmac Feb 24 '19 at 12:10
  • @chmac not with AFP. In the end I stopped using Time Machine entirely, and use `borg`/`borgmatic` to create backup volumes local and network volumes. It's still possible for rsnapshot to capture an inconsistent state of a borg archive though. – davidA Feb 25 '19 at 22:17

2 Answers2

2

I'd avoid Time Machine for a group of Mac computers. Far too many issues with the sparse bundles and corruption of the backups.

When presented with a similar situation, I went with CrashPlan after finding the Time Machine approach unsuitable for production.

Backup strategy for developer-focused Apple environments?

ewwhite
  • 194,921
  • 91
  • 434
  • 799
  • Fair comment, and I'm looking into other options also. It will take time to change though, so I'd still appreciate any insight into how to resolve the sparsebundle backup issue in the meantime. Given that the TM backups are intact most of the time, they do need to be backed up. – davidA May 14 '14 at 20:56
  • It's a good question. – ewwhite May 14 '14 at 21:19
0

Thought.

Run snapshot on the mac devices themselves for actual backups, the Time Machine backups will be a supplement.

YES it is much better to have a Time Machine image to restore from, but having the files with rsnapshot is a great idea.

I am using amazon S3 mounted drives using Jungle Disk to store rsync or snapshot images.