TimeMachine is the way to backup your data on Mac systems. The backup and restore procedure work nicely out of the box with very little hassle involved. I used to backup my data on a local USB disk for some years. However, backups to a USB disk require you to connect the disk, otherwise no backups will be performed.
Apple will sell you the Airport Time Capsulate, which allows for remote backups. But it is also possible to configure your Raspberry Pi to offer remote backup capabilities for the TimeMachine. Turning your Raspberry into a backup target for the TimeMachine is as simple as installing an AFP server on it. In this blog post, I’ll walk through the process of configuring your raspberry to be a remote target for TimeMachine backups.
Full article here:
Create a TimeMachine Backup Storage on the Raspberry Pi (blog.lobraun.de)