Recommended Posts

I have symlinks in my sync-folders.

I want BT-Sync to follow them like they are the real files.

If I symlink a file that is far away in another non-synced folder I want that file to be synced.

Is it possible?

Share this post


Link to post
Share on other sites

Is it possible?

 

It's possible, but you may have to do your symlinks the other way around!

 

Also, it's worth considering WHY you actually want to do this!? - With other products, such as DropBox that only allow you to sync a single centralized folder, I can understand the need to symlinks/folder junctions, but given that Sync allows you to sync ANY folders on your device... do you really need to sync symlinks, when you can just sync the physical folder itself!?

Share this post


Link to post
Share on other sites

If one wants to have less shares to maintain, symlinks are not a bad option IMHO. Let's say a user has several software packages and their configs - for whatever reason - all reside in different folders. Now syncing all these configs to a NAS as backup is a pain if each one has to be set up as a single share, so by using symlinks, everything could be synced in one single share. but YMMV

Share this post


Link to post
Share on other sites

If you make symbolic links on an NTFS filesystem (ie. "junctions"), and provide a readonly secret for the folder, BTSync will copy the junctions and what they point to across to a Linux or Windows filesystem. (I have not tried this with read-write secrets.)

This suits me nicely, because I want to use BTSync to distribute installers for free software to people around the world who are working in language development in minority languages.

Suppose I have folders A, B, C, D, E, F, G and H, each of which contains other folders with installers in them. These are updated automatically as the software developers put out new versions.

Some people want to get all folders, A to H, but other people never have a good internet connection, so they only want to get a subset. Some might want A and C and E, others would want to get A, E, F and G. I enjoy being able to make a folder that provides A, C and E by readonly secret, and another folder that delivers A, E, F and G. And I make a third folder that delivers all, A to H.

I have a pilot system working on a Windows box set up like this, and you could copy a couple of the readonly secrets and sync from this system if you would like. The readonly secrets are at

https://www.wuala.com/LangTran/BTSync_info/?key=36cZUC2vtjDO

Download the file and open it, approve Java to run, then copy a secret to the clipboard. Set up a receiving folder on your system, plug in the secret and you'll get the goods. Repeat for another secret.

 

But to scale up to higher bandwidth, I don't want to rent a Windows system in the cloud, I'd like to rent a Linux system. So, like MoonKid and nils, I would like to see BTSync handle symbolic links on Linux file systems the same way as it does on NTFS filesystems, namely to follow the symbolic link and copy the files at the target across to the destination.

 

Some people on the forum at

http://forum.bittorrent.com/topic/17112-linuxunix-symlink/

said they don't want BTSync to follow symbolic links, so I think the feature should be configurable.

The developers might also want to put in restrictions like

  1. only follow symbolic links that point to targets in the same file system
  2. only follow symbolic links if the secret is a readonly one

GreatMarko, you suggested making more BTSync links between source and destination, but in my case that would become very cumbersome for the recipients. I'm actually dealing with a lot more folders than A to H.

 

If you would like to read about this whole software distribution system, you can go to

http://lingtransoft.info/apps/langtran

 

Developers, I hope you are reading. We have been asking for this since about May 2013.

Share this post


Link to post
Share on other sites

Thanks, capi, I looked it up and worked out a solution.

 

As well as using

   mount --bind

you also have to put the equivalent in /etc/fstab (in Ubuntu), so I came up with a shell script to do it, which I called BT-bind.

Here's its usage message:

jim@langtran:~$ BT-bind
 
BT-bind: incorrect command line arguments
 
BT-bind here.
 
I'll Make a new folder in the folder tree to be shared with BTSync
then bind a folder from somewhere else to that new folder
and add the equivalent command line to /etc/fstab
 
Usage: BT-bind   folder-where-data-are   new-folder-to-share-them
Eg: BT-bind   /home/jim/music/classical  /home/jim/BTSync/music/classic
Eg: BT-bind   /usr/local/music/jazz      /home/jim/BTSync/music/jazz
 
This will let you share all your classical and jazz files
from a single folder, /home/jim/BTSync/music
 

After running this script many times, I have lots of folders bound to mount points. Here's a selection of them, which contain software installers useful for literacy work in minority languages:

jim@langtran:~$ mount|grep Literacy
/data/LT/Groups/LangTran_Literacy on /data/LT/BTSync/Win_everything_en/Literacy_all type none (rw,bind)
/data/LT/Groups/LangTran_win_Literacy on /data/LT/BTSync/Win_everything_en/Literacy_win type none (rw,bind)
/data/LT/Groups/LangTran_Literacy on /data/LT/BTSync/Win_FldWrk_en/Literacy_all type none (rw,bind)
/data/LT/Groups/LangTran_win_Literacy on /data/LT/BTSync/Win_FldWrk_en/Literacy_win type none (rw,bind)
/data/LT/Groups/LangTran_Literacy on /data/LT/BTSync/Linux/Literacy_all type none (rw,bind)
/data/LT/Groups/LangTran_Literacy on /data/LT/BTSync/Mac/Literacy_all type none (rw,bind)
 

I'll upload the script as an attached zip file, for any who would like to use it.

 

But it will be much easier when the BTSync developers make an option to allow the Windows and Mac clients follow symbolic links in filesystems on Linux systems :-)

 

BT-bind.zip

Share this post


Link to post
Share on other sites

Your workarounds are horrible. I want to sync symlinks.

And in my usecase it is like "nils" explained. There are a lot of config-stuff from different applications I need to sync. There is now way for your workarounds and now way for do the symlinks the other way around.

A symlink is just a file like any other. There is no problem with it. Why does btsync exclude them?

Share this post


Link to post
Share on other sites

Your workarounds are horrible. I want to sync symlinks.

And in my usecase it is like "nils" explained. There are a lot of config-stuff from different applications I need to sync. There is now way for your workarounds and now way for do the symlinks the other way around.

A symlink is just a file like any other. There is no problem with it. Why does btsync exclude them?

And I thought my workaround was so clever :-(

If you use the script that I uploaded, you'll find it's no harder to use than

ln -s

and it contains a lot of error checking, so you won't do the wrong thing by mistake.

 

I would be wary of using symlinks "the other way around" myself, though I'm not sure what you mean by that.

 

In one sense, a symlink is just a file like any other, but in another way it is not. it becomes meaningless if you copy it to a different filesystem, unless you include the systemname in the destination. I think there are good reasons why the BTSync developers haven't just flicked a switch and included them. They probably said, "We need to think a lot about the implications", and they have other problems to deal with at the moment.

 

Since we depend on those developers to do the work, and the number of Linux installs is probably tiny in comparison to the Windows installs, and they don't make any money from this product anyway, I'm happy to have a workaround that works.

 

By the way, I had mentioned in earlier postings that the only secrets I want to share in this project are read-only, but I didn't mention that again in my most recent posting.

Share this post


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.