mac的时间机器备份可以支持外接硬盘和samba,用samba结合ceph存储时间机器的数据比较方便。samba需要4.8以上版本,实际用docker安装samba4.8,虽然mac可以挂载,但时间机器不能识别,fedora29上的samba4.9可以支持时间机器备份。
一、搭建samba用于备份
1、安装fedora29
2、安装samba
dnf install samba
3、配置samba,开启支持时间机器的配置
编辑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 # 以下配置用于支持时间机器 spotlight = yes vfs objects = catia fruit streams_xattr fruit:aapl = yes fruit:time machine = yes
4、重启samba,添加用户
systemctl enable smbsystemctl start smbsmbpasswd -a macbackup
5、用finder连接smb,打开时间机器,就可以看到挂载的volume
二、搭建netatalk用于备份
由于samba需要4.9的版本,centos7上无法用fedora29的samba源代码编译成rpm,在centos7可以用netatalk为时间机器提供备份
1、构建netatalkrpm包
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
编译好的rpm在/var/lib/mock/epel-7-x86_64/result中
2、安装配置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、创建登录用户,netatalk登录时,使用linux用户
# useradd -d /opt/share/macbackup -s /sbin/nologin macbackup# 不必创建home目录useradd -M -s /sbin/nologin macbackuppasswd macbackup
4、在finder中连接,afp://youre_ip,以用户macbackup登录,打开时间机器,可以看到挂载的volume
5、有些文章说要安装avahi,avahi不安装也可以,netatalk的端口为548
参考链接: