b0rman Posted February 26, 2015 Report Share Posted February 26, 2015 Hi! I'm using BTSync to sync files across three linux servers.Let's say we have 1 folder to sync. The problem is that folder is in tmpfs file system (it's in RAM) and every time when any of servers reboot initial script creates folder again and copy .sync folder there to tell BTSync that it can be synced. Of course it causes to erase all files from same folders on other servers. Is it possible to set this newly created empty directory to RO mode or set it's creation time to last year, for example with touch command, to get files from other servers instead of delete them there? Quote Link to comment Share on other sites More sharing options...
redhead Posted February 27, 2015 Report Share Posted February 27, 2015 > touch -t "200001010100" fileAnd your file will be created with mtime set at year 2000 january 1st at 1amSent from my GT-I9195 with Tapatalk Quote Link to comment Share on other sites More sharing options...
b0rman Posted February 27, 2015 Author Report Share Posted February 27, 2015 > touch -t "200001010100" fileAnd your file will be created with mtime set at year 2000 january 1st at 1amSent from my GT-I9195 with Tapatalk I know. I mean is this change enough for BTSync? BTSync have it's own DB about files to sync. Quote Link to comment Share on other sites More sharing options...
redhead Posted February 27, 2015 Report Share Posted February 27, 2015 The theory in btsync is to supply the file with newest times tamp, but at the same time it checks to see if the file CRC check has changed, since you have an empty folder, I would expect it to begin resyncing from the other servers, if the contence in the .sync folder shows an earlier time stamp.Sent from my GT-I9195 with Tapatalk Quote Link to comment Share on other sites More sharing options...
RomanZ Posted February 27, 2015 Report Share Posted February 27, 2015 @b0rmanSync has its own files DB - and that wouldn't be enough. But, IIUC you need to get files to ramdrive every time you reboot PC. You can start sync with the config file with pre-configured key and folder, pointing to your ramdrive. Does it works for you? Quote Link to comment Share on other sites More sharing options...
b0rman Posted February 27, 2015 Author Report Share Posted February 27, 2015 @b0rmanSync has its own files DB - and that wouldn't be enough. But, IIUC you need to get files to ramdrive every time you reboot PC. You can start sync with the config file with pre-configured key and folder, pointing to your ramdrive. Does it works for you? I need to get files to ramdrive from another servers with pre-configured key on startup. Is it possible? Quote Link to comment Share on other sites More sharing options...
RomanZ Posted February 27, 2015 Report Share Posted February 27, 2015 Yep, its possible. If you've got a Linux machine, try command "./btsync --dump-sample-config" - sample config file is pretty much self-explainable. Quote Link to comment Share on other sites More sharing options...
b0rman Posted February 28, 2015 Author Report Share Posted February 28, 2015 Yep, its possible. If you've got a Linux machine, try command "./btsync --dump-sample-config" - sample config file is pretty much self-explainable.Didn't find how sample config can help me not to loose files on another servers Keep in mind that directory should be at RW mode at normal state. Quote Link to comment Share on other sites More sharing options...
RomanZ Posted March 1, 2015 Report Share Posted March 1, 2015 @b0rmanIf I understand correctly, you need to setup a share from scratch on a ramdrive when your computer boots up - and get all the files there. This can be done with config file - you can pre-define folder with folder key in config mode - and Sync will get data there. As every time it will be setup on your ramdrive as a brand new share, Sync will not delete files, but will get them from other peers. Quote Link to comment Share on other sites More sharing options...
b0rman Posted March 2, 2015 Author Report Share Posted March 2, 2015 @b0rmanIf I understand correctly, you need to setup a share from scratch on a ramdrive when your computer boots up - and get all the files there. This can be done with config file - you can pre-define folder with folder key in config mode - and Sync will get data there. As every time it will be setup on your ramdrive as a brand new share, Sync will not delete files, but will get them from other peers. OK, how about webUI?I can just save .sync directory from tmpfs and copy it there after any reboot than set "Last modify" to 1970 year and start btsync. Will it solve my problem? What sholud I notice in sample-config?"overwrite_changes" key is for RO nodes and I need it in RW Quote Link to comment Share on other sites More sharing options...
RomanZ Posted March 2, 2015 Report Share Posted March 2, 2015 @b0rmanYou can enable WebUI in config as well. For the mtime - not, it won't work. When Sync is starting up, it is going to check all files it is aware of (=in DB) for changes. mtime or size change triggers content check. If the content has changed - Sync does not know exact time when file has changed and takes current time as change time. Briefly - if you do so AND some files has changed indeed, your Sync will send them to other peers. Quote Link to comment Share on other sites More sharing options...
b0rman Posted March 2, 2015 Author Report Share Posted March 2, 2015 But if I'll configure "shared_folders" in config file, then WebUI will be disabled./* !!! if you set shared folders in config file WebUI will be DISABLED !!! shared directories specified in config file override the folders previously added from WebUI. */What sholud I notice in sample-config?"overwrite_changes" key is for RO nodes and I need it in RW Quote Link to comment Share on other sites More sharing options...
b0rman Posted March 2, 2015 Author Report Share Posted March 2, 2015 OK, thanks everyone for answers. Solved it with rsync + bash script Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.