We're Hiring!

Watch DropBox directory without server restart

Having a problem deploying OMERO? Please ask new questions at https://forum.image.sc/tags/omero
Please note:
Historical discussions about OMERO. Please look for and ask new questions at https://forum.image.sc/tags/omero

The OMERO.server installation documentation begins here and you can find OMERO.web deployment documentation here.

Watch DropBox directory without server restart

Postby heidip » Wed Oct 12, 2011 4:45 am

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
heidip
 
Posts: 8
Joined: Fri Jul 15, 2011 4:50 am

Re: Watch DropBox directory without server restart

Postby jmoore » Wed Oct 12, 2011 8:49 am

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.
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany

Re: Watch DropBox directory without server restart

Postby heidip » Fri Oct 14, 2011 4:52 am

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
heidip
 
Posts: 8
Joined: Fri Jul 15, 2011 4:50 am

Re: Watch DropBox directory without server restart

Postby jmoore » Wed Oct 19, 2011 11:49 am

Glad to hear it, Heidi.

Cheers,
~Josh.
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany


Return to Installation and Deployment

Who is online

Users browsing this forum: No registered users and 1 guest