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
E-Mail according to directory (Read 3937 times)
markklass
YaBB Newbies
*
Offline



Posts: 10
E-Mail according to directory
Aug 16th, 2004 at 10:28pm
 
Hello all,

I need watchDirectory to monitor an FTP folder, and send an e-mail according to which directoy has activity. 

How can I configure watchDirectory to send an email to a different person depending on which folder has been modified?

Also,

I keep getting two messages when there is a change.
One indicating, that 'The monitored directory has detected a change."  How can I remove that?
Back to top
 
tendayrain1  
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2239
The Netherlands
Re: E-Mail according to directory
Reply #1 - Aug 17th, 2004 at 12:10am
 
Hello Mark,

There are a lot of ways to make the recipient of the email message more flexible.
Just as an example, you could create a recipient file in each monitored directory. Inside that file place a list of people you want to send a notification to,
Lets assume you monitor C:\Monitor and want john@mail.com and pete@mail.com to receive notifications for directory c:\monitor\hello.

Create the file C:\monitored\hello\recip.txt and put those email-adresses inside it (one per line).

Now change your wdautomail.bat....
almost at the end of this .bat file there is a line:
Code:
IF NOT "%BLATTO%" == "" SET BLTCMD=%BLTCMD% -to %BLATTO%
 


Change that to
Code:
SET BLTCMD=%BLTCMD% -tf "%WD_FILE_D%\recip.txt"
 



That should do the trick.
You could get even smarter, by checking if recip.txt does exist, and if not use a default from somewhere else.

Quote:
that 'The monitored directory has detected a change."  How can I remove that?

You probably told watchDirectory to fire DIRCHNG events. If you deselect that option, it won't send those messages.


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



Posts: 10
Re: E-Mail according to directory
Reply #2 - Aug 17th, 2004 at 3:06am
 
Gert,

I did the following....
Are there any repercussions?


GdPUtil -matches "%WD_FILE_D%" "C:\Inetpub\ftproot\optimedia*"
IF %ERRORLEVEL% == 1 SET BLATTO=xxx@mail.com
Back to top
 
tendayrain1  
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2239
The Netherlands
Re: E-Mail according to directory
Reply #3 - Aug 17th, 2004 at 3:33am
 
Good idea, should work fine.
Just remember that this will also match

C:\Inetpub\ftproot\optimedia\and\some\other\dir\below

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


I love YaBB 1G - SP1!

Posts: 2
Re: E-Mail according to directory
Reply #4 - Jun 17th, 2005 at 4:39am
 
Is there anyway to reflect the folder name on the email which is being modified or has a new file being transferred?  Email only gives users the new file name.  It does not show which folder/customer is sending the file.  I have several users which have multiple folder ownership.

Thanks in advance
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2239
The Netherlands
Re: E-Mail according to directory
Reply #5 - Jun 17th, 2005 at 4:47am
 
Yes,

If you want to have the complete filename (including the path) in the subject line you need to search inside the script for lines like:
Code:
SET SUB="A new file is created: %WD_FILE_N%" 


(There are several SET SUB=... lines in the script).
%WD_FILE_N% is "translated" to just the filename, if you change it to %WD_FILE% (without the _N) it will be translated to the complete path.

Other %variables% you can use are listed here:
http://www.watchdirectory.net/watchDir/help/bat.html

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