commit 0ba16f43ef258edfb1e4d72dd7527e029bda5261 Author: Krasimir Nedelchev Date: Sun Feb 23 15:39:07 2020 +0000 Initial commit diff --git a/.env.schema b/.env.schema new file mode 100644 index 0000000..a334615 --- /dev/null +++ b/.env.schema @@ -0,0 +1,2 @@ +AFP_LOGIN=username +AFP_PASSWORD=password diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d70ad07 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.env +data \ No newline at end of file diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..d5b220f --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "docker-timemachine"] + path = docker-timemachine + url = https://github.com/odarriba/docker-timemachine diff --git a/README.md b/README.md new file mode 100644 index 0000000..fc94b1c --- /dev/null +++ b/README.md @@ -0,0 +1,29 @@ +# Time Machine + +This container runs a Time Machine server for remote backups of computers running macOS. + +### Usage + +1. Create a `.env` file following the template provided in `.env.schema`. +2. Create a symbolic link called `data` pointing to your preferred backup location. Example command: `ln -s /media/TimeMachine data`. +3. Start the container with `docker-compose up -d`. + +### Notes + +##### Auto discovery + +To enable auto discovery you need to use Avahi daemon. On Ubuntu you can install it by running `sudo apt install avahi-daemon avahi-utils`. + +To configure Avahi to broadcast Time Machine you can follow these instructions (adapted from docker-timemachine's README): + +> - Copy the file from docker-timemachine/avahi/nsswitch.conf to /etc/nsswitch.conf +> - Copy the service description file from docker-timemachine/avahi/afpd.service to /etc/avahi/services/afpd.service +> - Restart Avahi's daemon: sudo /etc/init.d/avahi-daemon restart + +##### Performance + +macOS throttles Time Machine services to keep the OS more responsive, which can result in slower backups. You can disable this behavior with `sudo sysctl debug.lowpri_throttle_enabled=0`. This can be useful during the first backup, since it can involve transferring hundreds of gigabytes. After executing the command you should immediately notice higher disk and CPU usage and increased network activity. Time Machine's remaining time should also decrease drastically. + +**Once your backup is done, don't forget to run `sudo sysctl debug.lowpri_throttle_enabled=1` to revert the change, else your machine may end up noticeably slower for everyday tasks.** + +Source: https://www.reddit.com/r/apple/comments/5vb66w/speed_up_your_time_machine_backups_tremendously/ diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..127c8c9 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,20 @@ +version: "3" + +services: + time-machine: + build: ./docker-timemachine + container_name: docker-timemachine + env_file: '.env' + environment: + - AFP_NAME=Time Machine + - PUID=1000 + - PGID=1000 + volumes: + - ./data:/timemachine + ports: + - "548:548" + - "636:636" + restart: unless-stopped + labels: + # TODO: this should not be required? + - com.centurylinklabs.watchtower.enable="false" diff --git a/docker-timemachine b/docker-timemachine new file mode 160000 index 0000000..8464710 --- /dev/null +++ b/docker-timemachine @@ -0,0 +1 @@ +Subproject commit 84647102c6716e051f2d9971d16d9c8c2962a445