Author Topic: How often does Watcher watch? And a few more questions.  (Read 3010 times)

bboy

  • Newbie
  • *
  • Posts: 2
How often does Watcher watch? And a few more questions.
« on: March 25, 2007, 07:57:55 PM »
I'm trying to make a little app to move only new files to a folder on a server. Breifly I'd use Sync to mirror directories on 4 servers with four directories/folders, then I'd like use Watcher to watch the mirrored directories and move each new file/directory that arrives in the mirror to yet another server (for back up).

The files are large and I'd rather Watcher did not begin transferring until downloading ends.

How often does Watcher watch? Anyway way to delay Watcher's activation of FTP or perhaps I could applescript the activation and deactivation of the Watchers?

Any comments of the the use of sync and Watcher I outlined are very welcome.


JD

  • Administrator
  • FTP Guru
  • *****
  • Posts: 2157
Re: How often does Watcher watch? And a few more questions.
« Reply #1 on: March 26, 2007, 05:31:10 AM »
Watchers scan once every 10 seconds. There's no way to control this directly, although you could programatically (or via AppleScript) launch and quit the Watcher(s) as needed.

One problem I did consider when writing Watchers was that of a large file being written to the watched folder - I designed it so that the file will not be uploaded until its modification date stops changing. If the mod date remains static for long enough then it will be uploaded.

I can't think of any gotchas with your proposed scenario - hopefully it will 'just work' ...

If you have any problems/questions, I'm right here ;)

bboy

  • Newbie
  • *
  • Posts: 2
Re: How often does Watcher watch? And a few more questions.
« Reply #2 on: March 26, 2007, 01:10:24 PM »
Well if it waits for the time stamp to stop changing, that takes car of my concern that I'll be uploading partial files all the time and re-writing over them.....sounds like a recipe for disaster.

Thanks for the response. I'll post back with an implementation. Maybe someone else can use this somewhat clugely, but effective solution.

JD

  • Administrator
  • FTP Guru
  • *****
  • Posts: 2157
Re: How often does Watcher watch? And a few more questions.
« Reply #3 on: March 26, 2007, 01:33:57 PM »
I look forward to it :)