WatchDirectory home page
WatchDirectory Startseite (Deutsche Version)
Site WatchDirectory (Français)
  Welcome, Guest. Please Login or Register
YaBB - Yet another Bulletin Board
   
  HomeHelpSearchLoginRegister  
 
Page Index Toggle Pages: 1
How to control time watchdir updates file (Read 2539 times)
btfsc
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 2
How to control time watchdir updates file
Sep 21st, 2004 at 11:58am
 
Is there a way to have watchDirectory only update the mointored dir during certain hours ?
The program we are watching does an update every 10 seconds with or without data change.After approx 1500
no new data is gathered but we are still uploading the update via FTP. Would like to be able to set a time such as 0900 to 1500 for watchDirectory to update then suspend updating till the next time frame.

Thanks
Bill
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2239
The Netherlands
Re: How to control time watchdir updates file
Reply #1 - Sep 21st, 2004 at 12:40pm
 
Hello Bill,

You can probably add something to your .bat file to do that.
If you download/install our free GdPUtil program (http://www.gdps.dk/products/watchDir/GdPUtil.shtml) and add the following to the beginning of your .bat:

Code:
d:\Bin\GdPUtil.exe -datetime c:\temp\dt.bat
call c:\temp\dt.bat
del c:\temp\dt.bat
rem extract the first and second position from the hour
SET H1=%DT_HOUR:~0,1%
SET H2=%DT_HOUR:~1,1%

if %H1% == 0 GOTO :EarlyMorning
rem so it is 10  or later here
IF %DT_HOUR% GEQ 15 GOTO :QUIT
GOTO :AllOk
:EarlyMorning
rem the hour is in the range 00 - 09
IF %H2% LEQ 8 GOTO :QUIT
:AllOk
 



The reason I 'split' the DT_HOUR variable above, is because arithmetic on the command prompt will thing it contains an octal number when it starts with a zero.

Hope this helps,
Gert
Back to top
 

Gert Rijs - gert (at) gdpsoftware (dot) com
Blog: http://blog-en.gdpsoftware.com/
End Alzheimer's: http://www.alz.org&&...
WWW WWW GdPSoftware  
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2239
The Netherlands
Re: How to control time watchdir updates file
Reply #2 - Sep 22nd, 2004 at 3:23am
 
Another thought ...
If the program that updates the file always ADDS data to it, or does something else making the filesize change,  there is a watchDirectory setting that makes it detect file-changes based on filesize instead of the (default) last-write time.

Gert
Back to top
 

Gert Rijs - gert (at) gdpsoftware (dot) com
Blog: http://blog-en.gdpsoftware.com/
End Alzheimer's: http://www.alz.org&&...
WWW WWW GdPSoftware  
IP Logged
 
Page Index Toggle Pages: 1