准备使用netatalk在Ubuntu Server上搭建支持TimeMachine备份的文件服务器,查了一下netatalk新的版本已经不需要avahi了,不过apt-get获取的netatalk还是老版本的,so,下载源码编译安装
首先安装依赖
sudo apt-get install libssl-dev libgcrypt11-dev libkrb5-dev \
libpam0g-dev libwrap0-dev libdb-dev libavahi-client-dev \
libacl1-dev libldap2-dev libcrack2-dev systemtap-sdt-dev \
libdbus-1-dev libdbus-glib-1-dev libglib2.0-dev libevent-dev
下载解压netatalk3.0.5源码
wget http://softlayer-dal.dl.sourceforge.net/project/netatalk/netatalk/3.0.5/netatalk-3.0.5.tar.bz2
tar xvf netatalk-3.0.5.tar.bz2
cd netatalk-3.0.5/
配置&编译&安装netatalk
./configure --with-init-style=debian --with-cracklib --enable-krbV-uam --without-libevent --with-pam-confdir=/etc/pam.d --with-dbus-sysconf-dir=/etc/dbus-1/system.d
make
sudo make install
查看安装否正常
afpd -V
输出应该类似于:
|
|
配置TimeMachine文件夹
sudo vim /usr/local/etc/afp.conf
我准备使用/home/jason/WD目录做为共享文件夹, 所以我的afp.conf文件如下
;
; Netatalk 3.x configuration file
;
[Global]
afpstats = yes
;[Homes]
;basedir regex = /home
[WD]
path = /home/jason/WD
time machine = yes
afp.conf的配置说明可以查看官方文档afp.conf.
测试
回到mac, 到Finder里, 先Cmd+K连接服务器afp://ip.ip.x.x
,输入用户名密码,连接成功
再到TimeMachine设置里,选择共享的文件夹做为目标磁盘, 开始备份吧!