cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox tips & tricks

Learn how to get the most out of Dropbox with other users like you.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

linux inotify on file in Dropbox: no notification of update

linux inotify on file in Dropbox: no notification of update

Stephen B.25
Helpful | Level 7
Go to solution

I want to send a message between two of my Dropbox devices which are otherwise invisible to each other.

 

I am trying to do this by updating content of a file.

 

$echo test > ~/Dropbox/compound

 

I have a put inotifywait on  ~/Dropbox/compound and do not receive notification that the file has been updated. If I access the file by some other means, then I will receive a notification of that activity, but not when Dropbox client updates a file through its own notification system. 

 

Both clients status is  `up to date`.

 

 

1 Accepted Solution

Accepted Solutions

Stephen B.25
Helpful | Level 7
Go to solution

Ah that's it. inotify watches the file's handle not the name. So if Dropbox creates a new file then inotify loses its reference. 

 

So I have created a dedicated message subdirectory in Dropbox and put the watch on that *directory*. Now I am notified of changes to 'the file'

 

Thanks very much for your help. 

 

View solution in original post

2 Replies 2

Здравко
Legendary | Level 20
Go to solution

@Stephen B.25 wrote:

...

I am trying to do this by updating content of a file.

 

$echo test > ~/Dropbox/compound

 

 

I have a put inotifywait on  ~/Dropbox/compound and do not receive notification that the file has been updated. ...


Hi @Stephen B.25,

For sure there are better and more secure ways to achieve the same, in spite it's still interesting idea. In all cases when you change particular file inotifywait should react. I just checked it out and it's working. One thing you can think about is the word "updating"! 🤔 Do you actually actualize your file? Take in mind if particular file is uploaded more than single time with the same content, only first time (the actual change) is considered update. All rest uploads are just ignored! Are you repeating the same command again and again without changing "test" inside? 🧐 If so, that's your issue! 😁 You don't really update your file and that's why no any reaction can be expected. 😉 Fix it.

One more thing you should take in mind, on update event, Dropbox application doesn't update the file, but replace it in fact. This can push in confusion some monitoring systems in some cases (the same when some editor replace particular file instead of update it, Dropbox removes associated link, if any). Dropbox behaves like such replacing programs! This can affect your code in some special cases only.

Hope this helps.

Stephen B.25
Helpful | Level 7
Go to solution

Ah that's it. inotify watches the file's handle not the name. So if Dropbox creates a new file then inotify loses its reference. 

 

So I have created a dedicated message subdirectory in Dropbox and put the watch on that *directory*. Now I am notified of changes to 'the file'

 

Thanks very much for your help. 

 

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Stephen B.25 Helpful | Level 7
  • User avatar
    Здравко Legendary | Level 20
What do Dropbox user levels mean?