Page 1 of 1

Watch DropBox directory without server restart

PostPosted: Wed Oct 12, 2011 4:45 am
by heidip
Hi,
I've been playing around with the DropBox feature a little bit, and I'm wondering if there is a way to get the fs.client to watch new folders created in DropBox without resarting the server?

I've got some code in php that imports files to a /files directory.
It then checks if a user labelled directory exists in Omero's dropbox (e.g. DropBox/user1), and if it doesn't create the folder and move the files into it.
This part is working.
However, the files in a newly created folder stay there and are not imported to Omero.
I've looked at the logs and it seems that DropBox doesn't know they are there.
It appears that the fs.client doesn't start watching the folders in the DropBox directory until the server has been restarted. Is this the case?

If so, is there any way to change this so that the client starts watching any new folders as soon as they are created?
If this is not the case...any ideas why this might be happening?

Cheers,
Heidi

Re: Watch DropBox directory without server restart

PostPosted: Wed Oct 12, 2011 8:49 am
by jmoore
Hi Heidi,

heidip wrote: I've been playing around with the DropBox feature a little bit, and I'm wondering if there is a way to get the fs.client to watch new folders created in DropBox without resarting the server?


That should be the default, i.e. when you touch anything under the DropBox directory it should be processed as long as DropBox is running. For example,

Code: Select all
~/git/dist $ touch /OMERO/DropBox/root/test.txt
~/git/dist $ touch /OMERO/DropBox/test.txt
~/git/dist $ grep test  var/log/MonitorServer.log
2011-10-12 10:43:42,523 INFO ... New files      : ['/OMERO/DropBox/root/test.txt']
2011-10-12 10:43:42,523 INFO ... Event notification : [('/OMERO/DropBox/root/test.txt', Create)]
2011-10-12 10:43:51,815 INFO ... New files      : ['/OMERO/DropBox/test.txt']
2011-10-12 10:43:51,816 INFO ... Event notification : [('/OMERO/DropBox/test.txt', Create)]
~/git/dist $ grep test var/log/DropBox.log
2011-10-12 10:43:42,623 INFO  ... EVENT_RECORD::Cookie::1318409022.62::Create::/OMERO/DropBox/root/test.txt
2011-10-12 10:43:51,867 INFO ... EVENT_RECORD::Cookie::1318409031.87::Create::/OMERO/DropBox/test.txt
2011-10-12 10:43:51,867 ERROR ... File added outside user directories: /OMERO/DropBox/test.txt
2011-10-12 10:44:17,409 INFO ... Getting filesets on : set(['/OMERO/DropBox/root/test.txt'])


The ERROR line says that files shouldn't be created under /OMERO/DropBox directly but only under a directory with a user's name (/OMERO/DropBox/root). The last line is the beginning of an import attempt.

Can you show us the output of "bin/omero admin diagnostics" as well as send us the log files var/log/DropBox.log and MonitorServer.log?

Cheers,
~Josh.

Re: Watch DropBox directory without server restart

PostPosted: Fri Oct 14, 2011 4:52 am
by heidip
Hi Josh,

I wasn't looking at the MonitorServer.log and will definitely start doing so.

It is creating the watch and after a restart, and running my scripts from scratch, it now all works well, Yay!

Must have been an error in my scripts.

Thanks!

Cheers,
Heidi

Re: Watch DropBox directory without server restart

PostPosted: Wed Oct 19, 2011 11:49 am
by jmoore
Glad to hear it, Heidi.

Cheers,
~Josh.