Linux/Unix symlink


tracius01

Recommended Posts

  • 3 weeks later...
Following symlinks while synching is dangerous and wrong!

Oh yes.

$ ln -s .. up

$

It's much safer to include the actually required functionality directly in BTSync

By that I mean have a configuration file that lists the overlays you want ...

$ cat .Sync/overlay

videos -> /disk/largearray/videos/notporn

porn -> /disk/verylargearray

project_a -> /home/staff/jenny/appleproject

$

And have BTSync show the directories "videos", "porn", "project_a" even though they don't actually exist.

After all, to make it safe, you're going to be doing that anyway and this way it's all local; no need to add it to the multi-peer finite state machine diagrams.

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...

this would be great if it could follow symlinks. It currently follows hardlinks/junctions on windows, so I don't see why it can't do it on Linux too.

for example, i'd like to have a backup directory with a bunch of symlinks pointed to important stuff, and have that synced across computers.

Link to comment
Share on other sites

  • 2 months later...
  • 3 weeks later...

Hi !
I'm using for a while Dropbox, with wich I use lots of symbolic links, pointed to folders with useful stuffs and work, without moving these folders (separated disks/partitions in my case).

@Xanza : When I edit my LaTeX files, I have to move the new Pdfs in my synced folder… And my problem of separated partitions is quite complicated !

It would be an idea to let the user the choice to sync or not the pointed folders/files… Or even to be able to set it for each folder ! (for example with/without a '.sync_link' file in the folder)
 

Link to comment
Share on other sites

I have managed to hack a script together which manages this this quite well. It should work on any Unix platform but on Mac OS you'll need to compile the hlink and hunlink programs in order for it to work. If you are not on Mac OS, you'll need to edit the script to use "ln -d" to hard link the directories.

 

I am using this to manage the music I wish to sync to my phone, as I don't think the manual selection in the android app is very good.

#!/bin/bashcd "/Volumes/Marceline/MusicSync/"# first unlink files which have been removedfor artist in *; do    if [ -d "$artist" ]; then      if ! grep -Fxq "$artist" "links" ; then        echo Unlinking $artist        hulink "$artist"      fi    fidone# link any new oneswhile read artist; do  if [ ! -d "$artist" ]; then    echo Linking $artist    hlink "../Music/$artist" "$artist"  fidone < links

It needs a file, in this case links to contain a list of the directories you want linked up. Example:

Bright EyesBryan John ApplebyConor Oberst & The Mystic Valley BandDeath Cab For CutieEdward Sharpe & The Magnetic ZerosFeist & Ben Gibbard

It seems to work pretty well for me but obviously I have no guarantees it'll work for you. 

Link to comment
Share on other sites

  • 5 weeks later...

@Limes102:  Hard links are a nonstarter, since they cannot span more than one filesystem (an inode number in one filesystem has absolutely no bearing on another filesystem).  My files reside on my NAS because it has far greater capacity than my workstation hard drive.  Without symlinks, I'm forced to copy files from my main file store, duplicating the amount of space used.

 

@tiptronic: 

 

get yourself a Mac - its dead simple there  

No way no how am I *ever* going to buy a Mac.  Overpriced hardware for what you get, and I'm not into buying used equipment.

Link to comment
Share on other sites

  • 2 months later...

I don't think there is any update yet from the BTSync developers, but I have created a Unix/Linux script that uses

mount --bind

to mount folders at mount points within the filesystem. It also puts the equivalent commands in /etc/fstab so these bindings are remade when the system is rebooted.

You can read about my script at

http://forum.bittorrent.com/topic/23624-symlink/?p=78762

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

Has this feature been abandoned? Could really be useful, I pretty much rely completely on symlinks

As the wise owl said, it's on the list, but there are higher priorities.

In the mean time you could use the script that I developed to use

   mount --bind

to make the equivalent of symbolic links on your Linux system.

You can find it at http://forum.bittorr...ymlink/?p=78762

See the following discussion as well.

Link to comment
Share on other sites

@scruffyfox & @all,

 

There are several peculiarities around going over symlinks as over folders. Let me make a list.

1) Symlinks are ruining tree-shape of the directory structure. They can wrap directory structure into itself.

2) Symlinks can drive BTSync out of directory (and store in general much more information than user expect)

3) Symlinks can bring BTSync to some network location which contains more info than expected

4) Symlinks can bring BTSync to a filesystem which is not compatible with current FS. 

5) <probably some other peculiarities which i'm missing right now, but you also can guess>

 

How do you expect (or find useful) for BTSync to deal with such issues?

Link to comment
Share on other sites

How do you expect (or find useful) for BTSync to deal with such issues?

Agreed! At the end of the day, sync isn't like DropBox or OneDrive (SkyDrive), etc that limit you to only syncing one central folder - in these instances, I can understand why SymLinks would be very useful to allow you to sync the content of other folders too!

 

But given that BitTorrent Sync allows you to select and sync ANY folder, surely the need for using SymLinks with Sync is far less than if you're using DropBox/OneDrive, etc, as you can add all the folders you wish to Sync themselves directly?!

 

I suspect that's probably why - although better handling SymLinks is in the development "queue" - it's currently not considered the "highest priority" for the team.

Link to comment
Share on other sites

For me the Symlinks  are generally useful, but is a personal point of view, may be not useful for any other.

 

They could introduce more complexity so they need to be evaluated

 

May be some suggestion on how they are handled could be found here

 

http://rsync.samba.org/ftp/rsync/rsync.html 

Chapter Symbolic Link

 

Anyway i'm not sayng that btsync equals rsync or similar thing  , this is only a suggestion, and i actually prefer btsync in some cases in my daily use (more easy to use at all, no needed ssh server , no port configuration etc etc  :) )

Link to comment
Share on other sites

@antimojv,

 

The manual still does not address the issues i've highlighted. rsync distinguishes some "safe" and "unsafe" symlinks for themselves, but I believe it is not applicable in BTSync case: people want symlinks to point outside of the sync folder (main usage scenario - accumulating all backup data in one folder).

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.