LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-03-2013, 11:47 AM   #1
parnmatt
Member
 
Registered: Apr 2013
Location: Lancaster
Distribution: Mac OS X
Posts: 38

Rep: Reputation: 7
Question Unidirectional symbolic links


Hi all,
My Google-fu has come up short, and I can't find any solution to my problem.

I'm looking for a way to create a unidirectional symbolic link.

I use Dropbox for back-up and file/folder sharing, an excellent service, but lacks one important feature: Read-only folder sharing.

My (initial) aim is to share my photos directory with my girlfriend, synced over dropbox. Currently I'm using symlinks to the dropbox folder so that it doesn't waste space, however, I have a separate folder with just our photos that's currently being shared.

It's a duplication of my files, which are taking up space, both on my computer and on my dropbox.

The reason I don't just share the one folder is the read-only thing.
I trust her, but if something were to go wrong, I would rather her not accidentally deleting or changing my photos directly.

The only way I can think of that would solve my issue with dropbox, is to find away of creating unidirectional symbolic link.
A symlink which is in essence read-only in the dropbox folder, but read-write in the normal directory.

So that I can make change/addition, and it syncs with the server.
It then downloads on her computer via dropbox.

However if she makes a change, it'll sync to the server, download the changes to my dropbox folder, which would automatically return back to the state it was before her change, then sync with the server, changing it back on hers again, etc..

I have no idea how to make such a link.
Wondering if anyone did know.

However I know it can be done with something like a script that triggers in response to dropbox syncing. It would probably run a diff against the folders, and if there is any difference to use rsync or simply cp etc.

Thanks for any thoughts.

Last edited by parnmatt; 06-05-2013 at 01:06 PM. Reason: Changed first reference of 'her' to correctly imply my girlfriend.
 
Old 06-03-2013, 04:11 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Looking at the number of views vs. the lack of responses I can only guess
that people don't understand what you're asking (I don't).

All links are uni-directional. That kind of makes your question moot. Unless
of course you're using the wrong terminology, which is what I suspect.

Maybe if you explained more about what you're doing, how you're utilising
dropbox, what OS you're using, and who *she* is, and how she utilises your
photos. Do you live together? Where does she sit in relation to your
home network?
 
Old 06-05-2013, 01:06 PM   #3
parnmatt
Member
 
Registered: Apr 2013
Location: Lancaster
Distribution: Mac OS X
Posts: 38

Original Poster
Rep: Reputation: 7
Arrow

TL;DR at bottom.


Quote:
Originally Posted by Tinkster View Post
and who *she* is, and how she utilises your
photos. Do you live together? Where does she sit in relation to your
home network?
Sorry I forgot to mention, I feel stupid.
She is my girlfriend. We do live together, and we usually are sharing a network, though she is on Windows 7.
However I want a network independent solution, and for the files to exist on her computer, hence the use of Dropbox, as we both use it.

NOTE: I will amend the original post to correct this.

Quote:
Originally Posted by Tinkster View Post
All links are uni-directional. That kind of makes your question moot. Unless
of course you're using the wrong terminology, which is what I suspect.
I'm using unidirectional, as it's literal meaning: "one-way", as in the data is being linked in one direction.
For example:
  • dirA and dirB are both linked symbolically.
  • Normally, if you change dirA, then dirB would also change as it's acting as it's the same directory, and only taking up the space of one directory, not two.
  • The converse is also true.

I am asking if it is possible to create a link in which the data can only be updated in one of the directories.
  • dirA and dirB are both linked symbolically, (in what I call unidirectional)
  • It is set up that If I change the contents of dirA, then dirB would also change.
  • However the converse would not be true.
  • If I change the contents of dirB, then dirA would not change (as if it doesn't have permission), and dirB is returned to the state it was in previously, the same as dirA.
  • Also both pointing to the same data, therefore only takes up one directory worth of space, not two.

Quote:
Originally Posted by Tinkster View Post
Maybe if you explained more about what you're doing, how you're utilising
dropbox, what OS you're using,
I thought I did explain this is high detail; I'll bullet point it for the tl;dr nature of the long post.
  • I have photos
  • I want to sync them to my girlfriend using Dropbox, so they are on her computer
  • I want her to have (in essence) Read-only access to the folder
  • I can make changes/additions to the directory, she cannot.
  • Having two unlinked directories with the same content, takes twice the room of one, and I have to manually update both.
  • I want to use symlinks to minimise the hdd space taken, and for the process to be automated.
  • This currently works, but Dropbox does not support Read-only shared folders (thought it's the most requested feature), therefore any changes she makes, influences my copy too.

The machine that this would be implemented on happens to be running Mac OS X Lion, however because of the nature of symlinks, dropbox and the nature of what I am asking, the solution shouldn't depend on OS, that is why I asked without stating.
Only way I can think that it would is if the symlink from, say, Arch had this ability with a flag, whereas CentOS doesn't.

Just as Dropbox isn't actually important here. This (if possible) would all be happening locally.

As I previously noted, I know I can use automated scripts using diff and rsync, but this would require still having two unlinked directories on my computer, which would therefore take up twice the hdd space.


TL;DR All I am asking for:
Is it possible to make a symlink that only allows the target to be updated via the source, and not vice-versa?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Symbolic links myzoneajay Linux - Newbie 3 02-16-2013 10:35 AM
[SOLVED] Symbolic links Matx Linux - Newbie 4 01-02-2013 10:57 AM
symbolic links _Linux_Learner Linux - Newbie 2 02-26-2010 04:39 PM
Symbolic links Vs Hard links sulekha Linux - General 2 10-02-2008 08:03 AM
Symbolic links pdstatha Programming 1 04-08-2002 10:50 PM


All times are GMT -5. The time now is 06:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration