One Way Sync That Never Deletes Files On Target Machine


Recommended Posts

I would like to setup a one way sync that never deletes files on the target machine even if they are removed from the source machine. Right now the files that are deleted on the source machine are moved to the archive on the target machine. I would like to find a way for the files to be left in place if possible.

 

These are the settings that I'm using so far on the target machine:

 

1. I setup a read only link from the source device

2. I changed the sync_trash_ttl to 0

 

Are there any other settings that I need to change?

 

Thanks.

Link to post
Share on other sites
  • 3 weeks later...

Hi, I have searched for hours trying to find the location of "sync_trash_ttl" on a windows machine. I'm using the web UI and its not under preferences and advanced or in the setting.dat in appdata. where is the location of this ever elusive setting?

 

Advanced settings, such as sync_trash_ttl, are sadly not currently available through the Web UI on Windows - you'll need to either run Sync with a config file and specify sync_trash_ttl in that, or if you have IE>9 installed, run Sync in "window" mode (instead of Web UI mode), and you'll be able to modify the setting via Preferences (cog icon) -> Advanced -> More Options

Link to post
Share on other sites

Thanks for replying GreatMarko!

Windows Server 2003R2 64bit

Couple of questions:

 

1) So my understanding is based off reading some other threads is that I can create a conf file and save it to the user acct "C:\Documents and Settings\"*********"\Application Data\BitTorrent Sync" or is it to "C:\Program Files (x86)\BitTorrent Sync"?

2) Here's How the config file looks based off previous threads. I'm not sure what the storage file is for, is that the path for the files I want to sync or the location of the Sync.exe file?

{
    "storage_path" : "XXXXXX",
    "use_gui" : true,
    "webui" : {
        "listen" : "127.0.0.1:8888",
        "login" : "<XXXXXXX>",
        "password" : "<XXXXXXXX>",
        "api_key" : "<XXXXXXXXXXXXXXXXXXXXXXXXXXX>"
 
    }
}

 

3) How would I incorporate the  "sync_trash_ttl" into that file? Also do I need to incorporate the other settings or will it default to what I have set in the Web UI?

 

4) Finally, How do I start the BitTorrent sync from the config file? Would that be in the command line <<btsync.exe /config your_config_file.conf>>


Thanks Again!
 

Link to post
Share on other sites

1) So my understanding is based off reading some other threads is that I can create a conf file and save it to the user acct "C:\Documents and Settings\"*********"\Application Data\BitTorrent Sync" or is it to "C:\Program Files (x86)\BitTorrent Sync"?

Either, but it'll be simpler if you place it in the same directory as your BTSync.exe

 

2) Here's How the config file looks based off previous threads. I'm not sure what the storage file is for, is that the path for the files I want to sync or the location of the Sync.exe file?

It's for the location where the databases are stored i.e. ("C:\Documents and Settings\"*********"\Application Data\BitTorrent Sync")

 

3) How would I incorporate the  "sync_trash_ttl" into that file?

"sync_trash_ttl" : 30,

 

Also do I need to incorporate the other settings or will it default to what I have set in the Web UI?

No, you can omit settings you don't explicitly wish to set

 

4) Finally, How do I start the BitTorrent sync from the config file? Would that be in the command line <<btsync.exe /config your_config_file.conf>>

Yes - which is which it's best to put your .conf file in the same directory as the executable.

You could alternatively create a .bat file (in the same directory as the BTSync.exe) containing the following:

START BTSync /config your_config_file.conf

Link to post
Share on other sites

Hi GreatMarko, I created the config file and the batch file to start BitTorrent Sync, which both are in the following dir "C:\Program Files (x86)\BitTorrent Sync". I added the "sync_trash_ttl" : 0, to the config file but the archive files are still deleting after 30 days.

Here's my config file set up:

 

{

 

"storage_path" : "C:\Documents and Settings\"user"\Application Data\BitTorrentSync",

"use_gui" : true,

"webui" : {

       "listen" ; "127.0.0.1:8888",

       "login" : "*****",

       "password" : "*******",

       "api_key" : "<<is this the Key generated in WebUI?>>"
       "sync_trash_ttl" : 0,

    }

}

 

 

Any ideas as to why its not working? Thanks for all your help

Link to post
Share on other sites

Any ideas as to why its not working? Thanks for all your help

 

Yes - take the sync_trash_ttl part out of the webui section! i.e:

 

{"storage_path" : "/Documents and Settings/user/Application Data/BitTorrent Sync","use_gui" : true,"webui" : {       "listen" ; "127.0.0.1:8888",       "login" : "*****",       "password" : "*******"    },"sync_trash_ttl" : 0}

Also, the api_key section is for a developer API key - not for a folder's generated RW/RO key.

 

If you don't have a developer API key, you can omit this line

 

Link to post
Share on other sites

Ok, I've done all that above and omitted the API key and the archive is still removing files after 30 days. I started BitTorrent with the config file and the Web UI is still loading and asking for a login. Is that what it should be doing? Am I missing something?

{

"storage_path" : "\Documents and Settings\"user"\Application Data\BitTorrent Sync",
"use_gui" : true,
"webui" : {
       "listen" ; "127.0.0.1:8888",
       "login" : "admin",
       "password" : "*********"
    },

"sync_trash_ttl" : 0

}

 

Thanks

Link to post
Share on other sites

@Surfingnewport

Couple more things for your config:

 

1. The path you use looks relative. Does your Sync binary stays in C:\ location as storage path hints?

2. Escape the backslashes by doubling them: it should look like "C:\\Documents and Settings\\<username>\\..."

3. It asks for login and password as you specified to demand it in WebUI.

4. If above does not help - send me yours settings.dat - i'll check if sync_trash_ttl was set indeed.

Link to post
Share on other sites
  • 1 month later...

I have a question as well about the storage_path param in the config file. can we use the windows variable to the folder:  %appdata%\\bittorrent sync ? 

 

If not, are there any problems with using ./ for the storage_path? 

 

I am going to be deploying this to several computers and would like to use the exact same config file to speed up deployment.

 

 

Also, earlier it was mentioned that the best way to is to put the config file in the same location as the .exe file. if you use the default location of c:\program files, or c:\program files(x86), when running btsync with the config flag (even with elevated command prompt) it was always give "Access Denied". 

Link to post
Share on other sites

@cadillacace

No, it does not support environment variables. The best storage_path can do is a relative path - so yes, putting it to ".\\" (you have to escape backslash in JSON) is going to work - if Sync is allowed to write data there. usually, apps that reside in Program Files are not allowed to write data there, so if you want to keep storage data next to binary - think of locating it outside of Program Files.

Link to post
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.