Skip to content

Instantly share code, notes, and snippets.

@egbertp
Created November 26, 2015 13:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save egbertp/c5024e2da032c34ef779 to your computer and use it in GitHub Desktop.
Save egbertp/c5024e2da032c34ef779 to your computer and use it in GitHub Desktop.
Install Syncthing

Install

$ brew install syncthing

WebGUI

http://127.0.0.1:8384/

Start automatically

Create the file ~/Library/LaunchAgents/syncthing.plist

$ vi ~/Library/LaunchAgents/syncthing.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!--
  Make sure the "syncthing" executable is located at ~/bin/syncthing.
  Replace the string "USERNAME" in this file with your username, such as "jb".
  Copy this file to ~/Library/LaunchAgents/syncthing.plist.
  Execute "launchctl load ~/Library/LaunchAgents/syncthing.plist".
-->
<plist version="1.0">
  <dict>
    <key>Label</key>
    <string>net.syncthing.syncthing</string>

    <key>ProgramArguments</key>
    <array>
      <string>/usr/local/bin/syncthing</string>
    </array>

    <key>EnvironmentVariables</key>
    <dict>
      <key>HOME</key>
      <string>/Users/USERNAME</string>
      <key>STNORESTART</key>
      <string>1</string>
    </dict>

    <key>KeepAlive</key>
    <true/>

    <key>LowPriorityIO</key>
    <true/>

    <key>ProcessType</key>
    <string>Background</string>

    <key>StandardOutPath</key>
    <string>/Users/USERNAME/Library/Logs/Syncthing.log</string>

    <key>StandardErrorPath</key>
    <string>/Users/USERNAME/Library/Logs/Syncthing-Errors.log</string>
  </dict>
</plist>

Unload with

launchctl unload ~/Library/LaunchAgents/syncthing.plist  

Load with

launchctl load ~/Library/LaunchAgents/syncthing.plist  
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment