Time machine backups using debian

Time machine backups using Debian 9

Install required service

apt install avahi-daemon

Get net talk to compile

apt install git
cd /usr/local/src
git clone https://github.com/adiknoth/netatalk-debian

Install dependencies

apt-get install build-essential devscripts debhelper cdbs autotools-dev dh-buildinfo libdb-dev libwrap0-dev libpam0g-dev libcups2-dev libkrb5-dev libltdl3-dev libgcrypt11-dev libcrack2-dev libavahi-client-dev libldap2-dev libacl1-dev libevent-dev d-shlibs dh-systemd

Compile netatalk

cd netatalk-debian
debuild -b -uc -us

Install netatalk

If it is ok it create files on parent directory, like libatalk*.deb and netatalk*.deb.

The versions may change, I use the following command to install:

dpkg -i libatalk16_3.1.7-1_amd64.deb netatalk_3.1.7-1_amd64.deb

Config netatalk

nano /etc/netatalk/afp.conf

Comment out the [homes] and add the following to the end:

# 5T limit
[TimeMachine]
path = /full-path/store-backups
time machine = yes
vol size limit = 5000000

Edit the config log file rotation

nano /etc/logrotate.d/netatalk

sample

/var/log/netatalk.log {
 rotate 13
 minsize 10M
 monthly
 copytruncate
 compress
 delaycompress
 notifempty
}

Ensure the services are started

systemctl  restart avahi-daemon
systemctl  restart  netatalk

The time machine configuration requires an linux user to connect, if you havent one yet, create one, eg:

useradd newuser
passwd newuser

The Time machine should be able to detect your server however, if it fails:

in Finder, Go > Connect to Server. Enter afp://<ip-server> and hit connect.

source: https://techsmix.net/timemachine-backups-debian-8-jessi/