Created
December 5, 2016 18:06
-
-
Save LTGIV/737abc1441125a7d7d84be0fd97866d6 to your computer and use it in GitHub Desktop.
systemd service : Apple Time Machine in Docker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Time Machine Service | |
After=docker.service setup-network-environment.service | |
Requires=docker.service setup-network-environment.service | |
RequiresMountsFor=/mnt/YOURDRIVEHERE | |
[Service] | |
EnvironmentFile=/etc/network-environment | |
TimeoutStartSec=0 | |
Restart=always | |
RestartSec=5 | |
ExecStartPre=-/usr/bin/docker stop TM-YOURNAME | |
ExecStartPre=-/usr/bin/docker kill TM-YOURNAME | |
ExecStartPre=-/usr/bin/docker rm TM-YOURNAME | |
ExecStartPre=-/usr/bin/docker pull odarriba/timemachine | |
ExecStart=/usr/bin/docker run \ | |
\ | |
--publish ${DEFAULT_IPV4}:548:548 \ | |
--publish ${DEFAULT_IPV4}:636:636 \ | |
\ | |
-e AFP_LOGIN=YOURUSERNAME \ | |
-e AFP_PASSWORD=YOURPASSWORD \ | |
-e AFP_NAME=TM-YOURMOUNT \ | |
-e AFP_SIZE_LIMIT=1000000 \ | |
\ | |
--hostname TM-YOURHOST \ | |
\ | |
--volume /mnt/YOURDRIVEHERE/tm-backups/YOURNAME:/timemachine \ | |
\ | |
--name TM-YOURNAME \ | |
odarriba/timemachine | |
ExecStop=/usr/bin/docker stop -t 30 TM-YOURNAME | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment