Hackviking He killed Chuck Norris, he ruled dancing so he took up a new hobby…

11Mar/160

BtSync: Let my NAS sleep

BitTorrent Sync (btsync) will re-index all files every 10 minutes to look for new files to sync. After installing btsync on Raspberry Pi initially and then ending up running it on an Odroid-C1 my WD NAS never sleeps. The first 48 hours it was expected since it took all that time to index all the files. But now my NAS never sleeps. Since this is a backup solution I don't have the need for it to actually re-index every 10 minutes. If the Western Digital LiveBook Duo is left alone for 20 minutes it will spin down it's hard drives. So here is a quick guide on how to configure the re-index interval for btsync installed on an arm system. This is done on the system initially installed with the Raspberry Pi: BitTorrent Sync guide.

If you edit any of the config files for btsync they will be overwritten at some point and all your new settings will be reversed. To reconfigure btsync we need to use dpkg-reconfigure. Below I also included a complete list of settings available in this tool but not going in further into what's what. For more detail on the basic settings look at my install guide: Raspberry Pi: BitTorrent Sync, this guide will work just fine on an Odroid-C1 as well.

dpkg-reconfigure btsync

This will send you into a similar config tool as the install.

btsync_config_start_screen

The first few options are the same as the install, we are looking for the Advanced settings at the end and specially Fall back folder rescan interval in seconds.

  • Define a default BitTorrent Sync instance - You have to answer Yes on this or it will disable your default instance. If you manage to do so just run the tool again and answer the questions and all will be back to normal.
    • BitTorrent Sync Daemon Credentials
    • BitTorrent Sync Daemon Group
    • Niceness of the BitTorrent Sync Daemon
    • Web Interface Bind IP Address
    • Web Interface Listen Port
    • Web Interface SSL
    • Start path for the web interface folder browser
    • BitTorrent Sync API Key
  • Configure Folder Defaults - default settings for new folders that you add, you can select No on this and still get to the advanced settings.
    • Preserve old versions of files
    • Sync using DHT by default
    • Sync using LAN broadcast by default
    • Sync using external relay servers
    • Sync using external tracker servers
    • Default known hosts list
  • Advanced parameters
    • Umask value for daemon
    • External port number reported to tracker
    • Perform disk operations with low priority
    • Encrypt data on local network
    • Speed limits in local network
    • Fall back folder rescan interval in seconds - by default this is 600 = 10 minutes. I change it to 43200 = 12 hours.
    • Maximum file size difference for patching
    • Maximum file size for versioning
    • Send buffer size
    • Receive buffer size
    • Maximum time difference between devices
    • Maximum time to live for versioned copies
    • Debug logfile size
    • Peer expiration days

After this the btsync service restarts and the new settings are in effect. After this change my NAS went to sleep just a 30 minutes later. After my last post Raspberry Pi: BitTorrent sync alternative Syncthing I had a discussion with several members of the Raspberry Pi Google+ group. A few had bad experience with btsync and large data sets. If I remember correctly there was issues of the system never completing the index of 150Gb of data. I now have 4Tb+ of data indexed and working just fine, it took about 48 hours for the initial index. I'm running this on a Odroid-C1 which have 1Gb of memory. When the cash is cleared (thanks Richard Parsons for your input) I had at least 400Mb of free memory. I would recommend running this on a system with at least 1Gb of memory, the quick tests I did on a Raspberry Pi model B with only 512Mb of memory was not good. I was however also running a MySQL instance on that machine. Another thing that worked better on the Odroid was the network speed, it has a 1Gbit ethernet port instead of the Pi's 100Mbit which made the indexing much faster since btsync actually reads all the data during the index process.

Hope you liked this post! Please follow me and comment with your thoughts, suggestions or any questions.

Comments (0) Trackbacks (0)

No comments yet.


Leave a Reply

No trackbacks yet.