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
Why doesn't GDPUtil work from this batch file? (Read 4388 times)
ahardesty
YaBB Newbies
*
Offline



Posts: 8
Why doesn't GDPUtil work from this batch file?
Oct 12th, 2005 at 4:40pm
 
I'm running a .bat file event from WatchDirectory 4 that looks like this:

[code]
d:\xpedio\bin\BatchLoader.exe /q /n%WD_FILE% -console
copy "%WD_FILE%" "%WD_FILE%".old
del "%WD_FILE%"

rem See if there are any old PDF files to be deleted
S:\gdp\gdputil.exe -deleteolderthan 1 S:\Collection *.PDF >> S:\Collection\Log\GDPutil.log
[/code]

Everything else works, I'm just not seeing the last line execute.

I can execute it from the DOS box with no problems.  Any reason why this wouldn't work?  I've stopped and restarted the task in the control center.


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



Posts: 2224
The Netherlands
Re: Why doesn't GDPUtil work from this batch file?
Reply #1 - Oct 12th, 2005 at 4:44pm
 
Is this task running as a service? Remember that mapped drives (and S: probably is a mapped drive) are not available to services.
You should change it to the UNC name of the S: drive (or move gdputil to a local drive).

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



Posts: 8
Re: Why doesn't GDPUtil work from this batch file?
Reply #2 - Oct 12th, 2005 at 4:48pm
 
Wink I actually changed that for the CODE snippet only, so as not to expose my lengthy server UNC.

I'm checking permissions right now.  I'll let you know what I end up with.
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2224
The Netherlands
Re: Why doesn't GDPUtil work from this batch file?
Reply #3 - Oct 12th, 2005 at 5:00pm
 
If you set the option to "capture output from .bat files" (on this page) and make sure there are no "echo off" lines in your .bat files, your task will write all output to *.log files in the directory
C:\Documents and Settings\All Users\Application Data\watchDirectory\YourTaskName

That may reveal some Windows error messages.

(press CTRL+9 in the WD Control Center to open Windows Explorer inside the task directory).

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



Posts: 8
Re: Why doesn't GDPUtil work from this batch file?
Reply #4 - Oct 12th, 2005 at 5:14pm
 
Hmm...now it's working.  I verified that I could run the gdputil.exe by running it with no cmdline params and that worked.

So, I next ran it with a -sleep 10 and that worked.

Then I thought I'd rearrange the cmdline params from:
Code:
-deleteolderthan 1 -hours -test \\myunc\collection *.pdf 


to this
Code:
-deleteolderthan 1 \\myunc\collection *.pdf -hours -test  



and that worked.

So I thought, just for fun, try it this way again
Code:
-deleteolderthan 1 -hours -test \\myunc\collection *.pdf 


and that worked too.

Is there something in gdputil that need to "initialize" the first time it's run?

Quite an odd behavior.  I'll keeo an eye on it.
Back to top
 
 
IP Logged
 
ahardesty
YaBB Newbies
*
Offline



Posts: 8
Re: Why doesn't GDPUtil work from this batch file?
Reply #5 - Oct 12th, 2005 at 5:16pm
 
AH HA   Cheesy

I think it was because the files I had copied to that directory to test were not actually 1 hour old yet!   Tongue

What date/timestamp does gdputil look at when processing a -deleteolderthan?  Created, Modified, Accessed?
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2224
The Netherlands
Re: Why doesn't GDPUtil work from this batch file?
Reply #6 - Oct 12th, 2005 at 6:24pm
 
-deleteolderthan uses the creation time
-modifiedolderthan used the last write time

Sometimes it is a bit confusing how the  "creation date/time" is set by windows when you copy a file (I always thought, the creation-date would be "now", but sometimes it is the original files creation date.

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