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
Copy Files Plug in (Read 1303 times)
jmendoza
YaBB Newbies
*
Offline



Posts: 4
Copy Files Plug in
Oct 23rd, 2012 at 5:09pm
 
Wanted to see if there is a way for me to only trigger the task if a certain criteria in the name matches. Files are named with specific dates on the filename. I just want to capture or copy the files for the day the task is scheduled to run.

For example:

The plug in would run every morning at 8:00 a.m. So if it runs on Oct. 30th. I need all files that contain "1030" on the name to be copied everything else it should ignore.

So I guess what I am asking is can we use dynamic naming on the filter events?

Can you help? Thanks.

-Joe

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



Posts: 2239
The Netherlands
Re: Copy Files Plug in
Reply #1 - Oct 24th, 2012 at 9:59am
 
Hello Joe,

The current WD version (free upgrade, just install over your version) has the option to use a "filter script", a batch file that determines if a detected file should be ignored or not.

Here is an example that checks if the detected file starts with the current MMDD.
Code:
@echo off
rem
rem this filter script (see http://www.watchdirectory.net/wdhelp/help/filter_events.html )
rem checks if the detected file (%WD_FILE_N% - see http://www.watchdirectory.net/wdhelp/plugins/wdopAutoRunBatEnv.html )
rem starts with the current month/day (MMDD).
rem

rem last 4 positions of WD_DATE (which has the current date in YYYYMMDD format)
SET MMDD=%WD_DATE:~-4%

rem first 4 positions of the detected file
SET F4=%WD_FILE_N:~0,4%

IF %MMDD% EQU %F4% GOTO :ProcessThisFile

GOTO :DoNotProcessThisFile



:ProcessThisFile
ECHO Y>"%WD_FILTERRESULT%"
GOTO :EOF

:DoNotProcessThisFile
ECHO N>"%WD_FILTERRESULT%"
GOTO :EOF

 

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