Get the App
SLTechnology News&Howtos  ›  Servers  › 

Build server for mac time machine backup on linux

Shulou Source: shulou.com Published: 2022-06-02 19:09:03 10月03日 Update

Mac time machine backup can support external hard disk and samba, samba combined with ceph storage time machine data is more convenient. Samba requires version 4.8 or above. Samba 4.8 is actually installed with docker. Although mac can be mounted, time machine cannot recognize it. Samba 4.9 on fedora29 can support time machine backup.

Samba is used for backup

1. Install fedora29

2. Install Samba

dnf install samba

3. Configure samba to enable the configuration of time machines

Edit smb.conf

[global] workgroup = SAMBA security = user passdb backend = tdbsam printing = cups printcap name = cups load printers = yes cups options = raw[macbackup] comment = mac backup path = /opt/share/macbackup browseable = yes public = no writeable = yes valid users = macbackup create mask = 0600 directory mask = 0700 #The following configuration is used to support Time Machine spotlight = yes vfs objects = catia fruit streams_xattr fruit:aapl = yes fruit:time machine = yes

Restart Samba and add users

systemctl enable smbsystemctl start smbsmbpasswd -a macbackup

5. Connect smb with finder, open the time machine, and you can see the mounted volume.

Second, set up netatalk for backup

Since samba requires version 4.9, samba source code for fedora29 cannot be compiled to rpm on centos7, and netatalk can be used to provide backups for time machines on centos7.

1. Build netatalkrpm package

yum install mockuseradd -m mock -g mocksu - mockwget http://www003.upp.so-net.ne.jp/hat/files/netatalk-3.1.11-1.4.fc29.src.rpm mock -r /etc/mock/epel-7-x86_64.cfg --rebuild netatalk-3.1.11-1.4.fc29.src.rpm

The compiled rpm is in/var/lib/mock/epel-7-x86_64/result

2. Install and configure netatalk

yum localinstall netatalk-3.1.11-1.4.el7.x86_64.rpmcat /etc/netatalk/afp.conf;; Netatalk 3.x configuration file;[Global]; Global server settings; [Homes]; basedir regex = /home; [My AFP Volume]; path = /path/to/volume; [My Time Machine Volume]; path = /path/to/backup; time machine = yes[Time Machine Voume] path = /opt/share/macbackup time machine = yes spotlight = novalid users = macbackup

3, Create login user, NetTalk login, Use linux user.

# useradd -d /opt/share/macbackup -s /sbin/nologin macbackup#No need to create home directory useradd -M -s /sbin/nologin macbackuppasswd macbackup

4. Connect afp://youre_ip in finder, log in as user macbackup, open time machine, you can see mounted volume

5, some articles say to install avahi, avahi can not be installed, netatalk port 548

Reference link:

https://blog.51cto.com/blogger/publish/2318250

https://www.jianshu.com/p/8716022d6551

https://kirb.me/2018/03/24/using-samba-as-a-time-machine-network-server.html

Tags: Machine time backup user support configuration login version compilation actual data article source code directory hard disk port link reference storage Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Redmi Linux MariaDB Huawei