Skip to content

Instantly share code, notes, and snippets.

@ties
Last active April 9, 2021 19:27
Show Gist options
  • Save ties/bb2c4723bbe03cd64c24e29fb096c194 to your computer and use it in GitHub Desktop.
Save ties/bb2c4723bbe03cd64c24e29fb096c194 to your computer and use it in GitHub Desktop.
Time machine with docker and samba, even on big sur. Three parts: docker-compose file, time machine config snippet (for in docker volume), and avahi service
# ...
samba:
image: dperson/samba
restart: unless-stopped
command: >-
-u "user;badpass"
-u "timemachine_rmbp;${TIMEMACHINE_RMBP_PASSWORD}"
-s "data;/media/data;yes;yes;yes;all"
ports:
- 139:139
- 445:445
environment:
- USERID=1000
- INCLUDE=/config/timemachine.conf
- NMDB=true
- TZ=Europe/Amsterdam
- RECYCLE=false
- WORKGROUP=workgroup
volumes:
- ./samba:/config:ro
- /srv/timemachine/timemachine:/media/timemachine
# ...
<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_adisk._tcp</type>
<txt-record>sys=waMa=0,adVF=0x100</txt-record>
<txt-record>dk0=adVN=time machine,adVF=0x82</txt-record>
</service>
<service>
<type>_smb._tcp</type>
<port>445</port>
</service>
</service-group>
[global]
fruit:nfs_aces = no
inherit permissions = yes
vfs objects = catia fruit streams_xattr acl_xattr
[time machine rmbp12]
comment = Time Machine retina macbook 2012
path = /media/timemachine/rmbp12
browseable = yes
read only = no
guest ok = no
writeable = yes
veto files = /._*/.apdisk/.AppleDouble/.DS_Store/.TemporaryItems/.Trashes/desktop.ini/ehthumbs.db/Network Trash Folder/Temporary Items/Thumbs.db/
delete veto files = yes
valid users = timemachine_rmbp
admin users = timemachine_rmbp
create mask = 0600
directory mask = 0700
spotlight = yes
# Some fruit settings
fruit:aapl = yes
fruit:encoding = native
fruit:metadata = stream
fruit:resource = xattr
fruit:time machine = yes
fruit:time machine max size = 300G
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment