Temporary Ro Mode?


b0rman

Recommended Posts

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

@b0rman

Sync 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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

@b0rman

If 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.

Link to comment
Share on other sites

@b0rman

If 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

Link to comment
Share on other sites

@b0rman

You 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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.