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
No output from batch file or vbscript (Read 5729 times)
joethompson
YaBB Newbies
*
Offline



Posts: 2
No output from batch file or vbscript
Mar 2nd, 2011 at 4:12pm
 
Hi, I'm hoping someone can help me as I'm banging my head against the desk with this one!!

I'm using the batch file plugin to launch a batch file when a file lands in a specific folder. The batch file performs several tasks:

1. Write the name of the newly arrived file (using the WD_FILE variable) to a log file.
2. Send the file to an external client using command-line cURL to send the file via FTP(S)
3. Move the sent file to an archive folder and output the result of the move to the log file.

Task 2 has a switch in which should create a trace log file which we can then use for future troubleshooting should a file not be sent correctly.

When I run the batch file outside of watchDirectory it performs exactly as intended, producing the required logs at each step along the way. When it's launched by watchDirectory though I only get the logging from stages 1 and 3, with the trace log failing to be created completely.

I've tried configuring the job to capture the output from the batch file in case this was where it was failing, but this seemingly captures no output at all. I've also tried converting the batch file into vbs and launching the cURL command from here with no better results.

The job is running as a windows service under a local user account configured on the server.

Does anyone have any ideas why watchDirectory may be blocking the output of the trace log and no other part of this batch file and / or how to fix it??

Any and all help gratefully received !!!  Undecided
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2239
The Netherlands
Re: No output from batch file or vbscript
Reply #1 - Mar 3rd, 2011 at 6:55am
 
Hello Joe,

Make sure to read http://blog-en.gdpsoftware.com/2010/04/watchdirectory-tasks-as-windows-service.h...

What I think may be happening is your logfile is created in the "current directory". Tasks that run as a Service have "C:\Windows\System32" as the current directory (I think). It may help if you start your batch script with

C:
CD \Temp

Hope this helps.
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
 
joethompson
YaBB Newbies
*
Offline



Posts: 2
Re: No output from batch file or vbscript
Reply #2 - Mar 3rd, 2011 at 1:40pm
 
Hi Gert,

Thanks for your help. In the end it was a permissions issue...

Running the script in manual mode (ie under my admin account) worked fine but running it under the service account I had designated for it generated the same fault - some logging worked but the trace log failed.

After a lot of testing I discovered that the service account I had set up didn't have read permissions on the cURL program folder and so was unable to run the file transfer command, hence no trace log was being generated as there was nothing to trace!! Doh!

Now all the permissions are configured correctly, the batch file is running exactly as intended.  Roll Eyes

Many thanks,
Joe
Back to top
 
 
IP Logged
 
Page Index Toggle Pages: 1