Time Capsule Setup
To mimic a Time Capsule, we need a NAS (network-attached storage) Drive. This is basically a drive that is shared on the network in a manner that allows other computers on the network to read and write to the shared disk.
The protocol used to share this disk will be Server Message Block (SMB - aka: Samba). To make it easier for Apple Time Machine to find this disk, we will make it advertise itself as a Time Capsule.
-
Use
ssh
to connect to your Raspberry Pi:ssh pi@raspberrypi-time
-
Follow these instructions to install Samba, and connect your USB hard drive: Use a Raspberry Pi 4 for Time Machine Backups.
The above instructions do not go into great detail about how to format and mount your external USB drive on the Pi, so I found this page helpful:
Format USB Drive -> See: “Format USB drives with a command line”.As an example, here's the contents of
/etc/fstab
on myraspberrypi-time
host:# added by Dan for TimeMachine backups # https://raspberrytips.com/format-mount-usb-drive/ # https://saschaeggi.medium.com/use-a-raspberry-pi-4-for-time-machine-works-with-big-sur-1e66a9650789 UUID=73c1affc-d29c-4246-969e-adf90d71a23e /mnt/timemachine ext4 sync,noexec,nodev,noatime,nodiratime 0 0
-
Since this Raspberry Pi is most likely headless, and you never really directly interact with it, you should have it setup to email you about its status. You should also set up this Pi to automatically update itself every night with the latest software patches available. See: Unattended Upgrades with Email Notifications. Nascent attempt at automating these steps: bin/install-auto-upgrade.sh. See related bin/README.md.
Many thanks to the authors of the above links!
Next step: Doc docs