So let's start. I'm assuming you do not have any other samba installed. The backup folder will pop up as "backup on <your linux server name>" and you will be using user name backups with the password you'll set on the way. I strongly recommend to read the howto I've posted at the end. It allows for a multi user setup.
Install samba:
sudo apt-get-repository ppa:linux-schools/samba-latestThis installs samba 4.8 that is a hard requirement to get SMB based TimeMachine backups working.
sudo apt update
sudo apt install samba
Let's get the old samba config out of the way
mv /etc/samba/smb.conf /etc/samba/smb.confORG
Now create and edit /etc/samba/smb.conf
[global]
server role = standalone server
passdb backend = tdbsam
obey pam restrictions = yes
security = user
printcap name = /dev/null
load printers = no
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=524288 SO_SNDBUF=524288
server string = Samba Server %v
dns proxy = no
wide links = yes
follow symlinks = yes
unix extensions = no
acl allow execute always = yes
# Special configuration for Apple's Time Machine
fruit:model = MacPro
fruit:advertise_fullsync = true
fruit:aapl = yes
fruit:time machine = yes
## Definde your shares here
[backup]
path = /space/backups
valid users = backups
writable = yes
durable handles = yes
kernel oplocks = no
kernel share modes = no
posix locking = no
vfs objects = catia fruit streams_xattr
ea support = yes
browseable = yes
read only = No
inherit acls = yes
Create and edit /etc/avahi/services/timemachine.service
<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_smb._tcp</type>
<port>445</port>
</service>
<service>
<type>_device-info._tcp</type>
<port>0</port>
<txt-record>model=RackMac</txt-record>
</service>
<service>
<type>_adisk._tcp</type>
<txt-record>sys=waMa=0,adVF=0x100</txt-record>
<txt-record>dk0=adVN=backup,adVF=0x82</txt-record>
</service>
</service-group>
#!/bin/bashAdd the backup directory, backup user and set permissions on the directory. This also sets the password for SMB/CIFS access:
echo " # starting samba from rc.local"
smbd
exit 0
useradd -m backupsAnd let's start this (no reboot required):
smbpasswd -a backups
mkdir -p /space/backups
chown backups /space/backups
chmod 700 /space/backups
/etc/init.d/avahi-daemon restartAnd there, the new backup destination should show up in all macs connected to this network. REMEMBER KIDS, DO ENCRYPTED BACKUPS!
smbd
ps. how to view you mac backups progress:
log stream --style syslog --predicate 'senderImagePath contains[cd] "TimeMachine"' --info
Credits:
https://www.reddit.com/r/homelab/comments/83vkaz/howto_make_time_machine_backups_on_a_samba/
2 komentarze:
Hey! I followed your tutorial, but I cannot get Samba Service to start with the server automatically. You have any idea what could be the problem?
I know that it does not launch at boot, but didn't investigate, hence recommendation to create /etc/rc.local. Make it executable and try again - this is something that I might have forgotten in the description.
And now it won't work anyway. Samba 4.8.5 in the repo is compiled with improper options. Need to wait for Samba 4.9.0 to be compiled for Ubuntu in some ppa.
Prześlij komentarz