LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 09-01-2016, 04:24 PM   #1
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,034

Rep: Reputation: 176Reputation: 176
Hard link file doesn't sync in Dropbox


I have a hard link set up. The original file is in the Documents folder and the other (both with the same file name) in my Dropbox folder. On the same computer the hard link works perfectly. Any change is reflected in the file in both folders. But when I get home and check my Dropbox, the file doesn't have any of the new information I've added to it.

I've tried it with the Mega cloud storage/snyc too. Same result.

Know why this is happening? Any way around it? Thanks.
 
Old 09-01-2016, 04:49 PM   #2
Hattablinux
LQ Newbie
 
Registered: Aug 2016
Posts: 4

Rep: Reputation: Disabled
Btw 68million password accounts leaked today by hackers change ur password
 
Old 09-02-2016, 01:53 PM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by Gregg Bell View Post
I have a hard link set up.
what is this?
please elaborate.
what's a hard link?
show us some output.
 
Old 09-02-2016, 02:01 PM   #4
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Quote:
Originally Posted by Gregg Bell View Post
I have a hard link set up. The original file is in the Documents folder and the other (both with the same file name) in my Dropbox folder. On the same computer the hard link works perfectly. Any change is reflected in the file in both folders. But when I get home and check my Dropbox, the file doesn't have any of the new information I've added to it.

I've tried it with the Mega cloud storage/snyc too. Same result.

Know why this is happening? Any way around it? Thanks.
Sure.

NONE of the cloud storage tools are immediate. It all depends on how often the local tool gets around to copying the updates to the remote storage. There can be delays of minutes or hours - there may even be a configuration option to increase the update rate - but note: increasing the rate will slow down your system, and increase your network load if you are doing something that updates the file - and it makes intermediate copies...

As far as I know, there is no way to make it faster - and still be usable.

Last edited by jpollard; 09-02-2016 at 02:02 PM.
 
1 members found this post helpful.
Old 09-02-2016, 02:16 PM   #5
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Quote:
Originally Posted by ondoho View Post
what is this?
please elaborate.
what's a hard link?
show us some output.
A Linux/UNIX file is represented by an array (stored on disk) of inodes (short for index node). A directory is just a file that has (at a minimum) an inode number, and the file name. When a file name is put in a directory the inode structure has a counter that gets incremented. This is the "link count", and the "hard link" is directory entry.

Since this is a logical structure, nothing prevents another directory from having an entry with the same inode number and a different file name. When this happens, the "link count" gets incremented - thus a second hard link.

A file is never deleted until the "link count" goes to zero. Other things to note is that if a file is open (reading or whatever) it causes the memory resident copy of the inode count to be incremented for each open system call for reading/updating the file. If the file name is deleted, the link count is decremented - but because the process having the open file busy prevents it from being deleted. If the system shuts down, the processes are terminated, and the link count is decremented - and when all processes that have the file open are terminated the count will be zero and the file is deleted.

As a side effect of this logical structure is that hard links cannot cross filesystems. For that purpose use a "symbolic link" which works very similarly (allowing multiple pointers to the same file), but those are implemented by actually creating a file (with a hard link), but the inode is specifically marked as "symbolic link" and the contents of the file are a path to the file being pointed to.
 
1 members found this post helpful.
Old 09-03-2016, 07:01 PM   #6
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,034

Original Poster
Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by jpollard View Post
Sure.

NONE of the cloud storage tools are immediate. It all depends on how often the local tool gets around to copying the updates to the remote storage. There can be delays of minutes or hours - there may even be a configuration option to increase the update rate - but note: increasing the rate will slow down your system, and increase your network load if you are doing something that updates the file - and it makes intermediate copies...

As far as I know, there is no way to make it faster - and still be usable.
Thanks jpollard but I don't think it's a speed issue. And Dropbox has never been slow to update. I mean, I turn the syncing computer on and I get a window saying: 'Dropbox has updated three files.'

Let's say I'm using a file, say in Documents again, and I'm making changes and then 'saving as' (and let's say there's a copy of that file already in Dropbox) in Dropbox. When I check my other computer both files are synced. When I do the hard link way (as described in my original post) it never syncs.

A friend said that hard links are often not "expected" by other programs, esp. something like Dropbox in Linux. I'm not sure what that means but I figured I'd throw it out there.
 
Old 09-05-2016, 12:23 AM   #7
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
please elaborate on what you think a hard link actually is and how your directory structure is set up, what you did that makes you think that the "hard link" is causing the issue.

and thanks jpollard, but i wanted additional info from op.

maybe the solution IS to use symbolic links instead.
 
1 members found this post helpful.
Old 09-06-2016, 12:07 PM   #8
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,034

Original Poster
Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by ondoho View Post
please elaborate on what you think a hard link actually is and how your directory structure is set up, what you did that makes you think that the "hard link" is causing the issue.

and thanks jpollard, but i wanted additional info from op.

maybe the solution IS to use symbolic links instead.
Thanks ondoho. I've used hard links. (To me, hard links are working on one file and having the changes show up on another file in another location, as well.) But the problem is with hard linking a file in Dropbox. When I get to my other computer the file is not updated. I guess you could say the hard link failed.

All I'm doing now is saving the file in my Documents folder and then overwriting the same file in Dropbox. It's all good now.
 
Old 09-06-2016, 01:14 PM   #9
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
Quote:
Originally Posted by Gregg Bell View Post
I've used hard links. (To me, hard links are working on one file and having the changes show up on another file in another location, as well.)
Then read what a hard link is. I suspect you're using soft links and that is why it is failing.
 
1 members found this post helpful.
Old 09-07-2016, 12:28 PM   #10
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,034

Original Poster
Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by 273 View Post
Then read what a hard link is. I suspect you're using soft links and that is why it is failing.
Thanks 273. This is how I made my hard links.
Attached Thumbnails
Click image for larger version

Name:	Selection_073.png
Views:	88
Size:	4.0 KB
ID:	22956  
 
Old 09-07-2016, 02:10 PM   #11
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
yep, that creates a hard link.
i never use them.
why are you using them?
the usual recommendation is to use symlinks: ln -s ...
 
1 members found this post helpful.
Old 09-07-2016, 02:30 PM   #12
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
It creates a hard link on the same physical volume. How does an "ls -la" look in the relevant folder?
Sorry, not doubting this but I can't think of any way for the OS to identify. A hard link in such a way as it doesn't copy it by default using a tool. I suppose, if the tool does have such restrictions, then it must be deliberate and, so, there may be a way to tun it off.
 
1 members found this post helpful.
Old 09-07-2016, 09:03 PM   #13
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,034

Original Poster
Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by ondoho View Post
yep, that creates a hard link.
i never use them.
why are you using them?
the usual recommendation is to use symlinks: ln -s ...
I'm using them because I read about them in my "Ubuntu Unleashed" book. LOL And I do like the idea of the file being in two places. If I accidentally delete one file, the other will still be there.
 
Old 09-07-2016, 09:05 PM   #14
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,034

Original Poster
Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by 273 View Post
It creates a hard link on the same physical volume. How does an "ls -la" look in the relevant folder?
Sorry, not doubting this but I can't think of any way for the OS to identify. A hard link in such a way as it doesn't copy it by default using a tool. I suppose, if the tool does have such restrictions, then it must be deliberate and, so, there may be a way to tun it off.
Hi 273. I'm just dabbling with them. If they were more important I'd really want to know what's happening with them but I don't even have to use them.
 
Old 09-07-2016, 11:54 PM   #15
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
well have you tried to use symlinks instead???
supposing the dropbox problem still persists.
 
  


Reply



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
[SOLVED] I lost Dropbox sync Gregg Bell Linux - Newbie 39 04-15-2016 08:26 PM
[SOLVED] Dropbox Public Link from Dolphin? BoydRice Slackware 3 04-24-2012 07:56 PM
Remote file Sync like dropbox wykthorr Linux - Software 3 12-31-2011 06:51 AM
File Sync/Storage Alternatives To Dropbox jmoschetti45 Linux - Software 3 02-26-2011 07:51 AM
Dropbox not sync-ing in KDE spoovy Linux - Desktop 2 03-16-2010 11:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:34 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
Open Source Consulting | Domain Registration