北肙

当你不能够再拥有,唯一可以做的,就是令自己不要忘记。

Setup Time Machine Backup Server for macOS on Gentoo Linux

1. install necessary packages 2. config netatalk 3. config avahi  4. add user for time machine 5. start services 6. add netatalk & avahi to default runlevel

1. install necessary packages

# emerge -avt avahi netatalk

2. config netatalk

# /etc/afp.conf
[Global]
uam list = uams_dhx2.so,uams_dhx.so
log level = default:info
log file = /var/log/afpd.log
hosts allow = 172.16.10.0/24
save password = no
sleep time = 1
[TimeMachine]
path = /home/timemachine
cnid scheme = dbd
ea = auto
time machine = yes
vol size limit = 1000000    # 1TB

3. config avahi 

//make netatalk disk available to MacOS time machine
# /etc/avahi/services/afpd.service
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_afpovertcp._tcp</type>
<port>548</port>
</service>
<service>
<type>_device-info._tcp</type>
<port>0</port>
<txt-record>model=TimeCapsule</txt-record>
</service>
</service-group>

4. add user for time machine

# useradd -m timemachine
# passwd timemachine
//create lv for dir '/home/timemachine' or any disk partition
# mount /dev/VGNAME/LVNAME /home/timemachine
# chown -R timemachine:timemachine /home/timemachine

5. start services

# /etc/init.d/netatalk start
# /etc/init.d/avahi-daemon start

6. add netatalk & avahi to default runlevel

# cd /etc/init.d
# rc-update add netatalk default
# rc-update add avahi-daemon default

Leave a Reply

Your email address will not be published. Required fields are marked *