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
check file size (Read 2920 times)
Timo
YaBB Newbies
*
Offline



Posts: 4
check file size
Mar 13th, 2011 at 10:59am
 
Hi,

every ten minutes a new file will be created on our server. I want to check the file size of the newest one and if the size is undersized, a mail will be send. Unfortunately I cant find any function in WatchDirectory Pro 4.6.5 to do this... anybody got an idea?

Thanks,
Timo
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2225
The Netherlands
Re: check file size
Reply #1 - Mar 13th, 2011 at 11:06am
 
Hello Timo,

Create a task using the "Run a bat file" plugin. Let it run a bat file with these contents:
Code:
IF %WD_FILE_SIZE% LEQ 1024 (
  ECHO %WD_DTTM% Small file %WD_FILE% (%WD_FILE_SIZE% bytes) >> "C:\alerts\alert.txt"
)
 



Everytime a small file is detected, a line will be appended to C:\Alerts\alert.txt
Now you can use the email task to monitor C:\Alerts to send those alert files.

See http://www.watchdirectory.net/wdhelp/plugins/wdopAutoRunBatEnv.html for more info about %WD_xxxx% variables you can use.

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
 
Timo
YaBB Newbies
*
Offline



Posts: 4
Re: check file size
Reply #2 - Mar 13th, 2011 at 6:12pm
 
It works, thanks!
Back to top
 
 
IP Logged
 
Page Index Toggle Pages: 1