Timemachine Backups & Debian 9 Stretch

OS: Debian 9 Stretch
Uname: Linux Balerion 4.3.0-1-amd64 #1 SMP Debian 4.3.3-7 (2016-01-19) x86_64 GNU/Linux

Install avahi-daemon

aptitude install avahi-daemon

Debian currently does not ship with version 3.X of netatalk. However, user adiknoth has been actively porting the upstream version of netatalk to be compatible with Debian.

git clone  https://github.com/adiknoth/netatalk-debian

Install Dependancies:

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

Make the .deb packages:

cd netatalk-debian
debuild -b -uc -us

The above created this files in the parent folder:

libatalk17_3.1.8-1_amd64.deb         
libatalk-dev_3.1.8-1_amd64.deb  
netatalk_3.1.8-1_amd64.changes  
netatalk-dbgsym_3.1.8-1_amd64.deb
libatalk17-dbgsym_3.1.8-1_amd64.deb  
netatalk_3.1.8-1_amd64.build    
netatalk_3.1.8-1_amd64.deb

Install the .deb's:

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

Setup the AFP config:

/etc/netatalk/afp.conf

; Netatalk 3.x configuration file

[Global]
; Global server settings
vol preset = default_for_all
log file = /var/log/netatalk.log
uam list = uams_dhx2.so,uams_clrtxt.so
save password = no

[default_for_all]
file perm = 0664
directory perm = 0774
cnid scheme = dbd
; Uncomment the following line to restrict access to specific users
; valid users = someuser

; The following is an example for a TimeMachine compatible volume,
; limited to a size of round about 5 Terabyte.
[TimeMachine]
path = <full-path-where-to-store-backups>
time machine = yes
vol size limit = 5000000

Create the logrotate configuration:

/etc/logrotate.d/netatalk

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

Ensure that netatalk and avahi-daemon are started and running.

service avahi-daemon restart
service netatalk restart

Timemachine should now be able to detect your server however, depending on your networking configuration, it may not be automatically found. If this is the case, in Finder, Go --> Connect to Server. Enter afp://<ip-address-of-server> and hit connect. Now, in Timemachine, you should be able to add it as a disk. Enjoy!

unsplash-logoChris Ried