mlaster

Members
  • Posts

    6
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by mlaster

  1. I've been running btsync 1.4 on my Mac with the "--config config.json" option.

     

    How do I create new "2.0-style" shares through the configuration file?  2.0 seems to work with classic 1.4 shares, and I suppose that is good enough. But I'd like to experiment with these new style of shares.

     

    If btsync finally added a daemon mode I'd definitely be willing to pay.  The --config approach works, but I'm flying blind since it doesn't have any sort of UI to monitor sync progress.

     

  2. I figured out how to get BT Sync running as a daemon, so wanted to post my findings.

     

    I'm running 1.3.109 since 1.4 was too unreliable for me.

     

    I create a directory in my home ~/Library/btsync_config to hold my config file:

     

    ~/Library/btsync_config> cat config.json

    {
        "device_name": “Bittorrent Sync Daemon”,
        "listening_port": 0,
        "pid_file": "/private/tmp/bt.pid",
        "check_for_updates" : false,
        "use_gui" : false,
        "use_upnp" : true,
        
        "shared_folders" :
        [
            {
                "secret": "<SECRET_KEY>",
                "dir": "/Users/_USERNAME_/Shuttle",
                "use_relay_server": true,
                "use_tracker" : true,
                "use_dht" : true,
                "search_lan": true,
                "use_sync_trash": true
            }
        ]
    }
     
    Then I create a launchd plist to start BTSync as a daemon on boot
     
    This file lives in /Library/LaunchDaemons:
     
    /Library/LaunchDaemons> cat com.bitorrent.sync.plist
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>Label</key>
    <string>com.bittorrent.sync</string>
    <key>UserName</key>
    <string>_USERNAME_</string>
    <key>KeepAlive</key>
    <true/>
    <key>RunAtLoad</key>
    <true/>
    <key>WorkingDirectory</key>
    <string>/private/tmp</string>
    <key>ProgramArguments</key>
            <array>
    <string>/Applications/BitTorrent Sync.app/Contents/MacOS/BitTorrent Sync</string>
    <string>--config</string>
    <string>/Users/_USERNAME_/Library/btsync_config/config.json</string>
    </array>
    </dict>
    </plist>
     
    Replace _USERNAME_ with your username so that BTSync runs as you (even when you aren't logged into the console)
     
    Once this file is created, tell launchd to start it with
     
    sudo launchctl load -w /Library/LaunchDaemons/com.bittorrent.sync.plist
     
    This seems to be working for me on OS X Yosemite.