I have several OSX client machines that back up via TimeMachine to AFP shares on an Ubuntu Linux 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 the HFS+ filesystem that TimeMachine uses, but from the server side it is just a collection of band files.
I have rsnapshot running every 4 hours on the server, which backs up the entire server onto a removable HDD (which I swap out frequently). Therefore rsnapshot is also backing up these sparsebundle bands at certain times of the day.
The problem is that if rsnapshot runs while a client machine has its sparsebundle mounted, 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. As far as I can tell, afpd doesn't provide a way to (easily) add/remove exports - one option is some complicated rewriting of afpd's config files to disable the TM exports, but this still takes down the AFP shares for a short time.
Is there a better way?