WatchDirectory Forum
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl
watchDirectory forums >> How to... >> Why doesn't GDPUtil work from this batch file?
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl?num=1129128010

Message started by ahardesty on Oct 12th, 2005 at 4:40pm

Title: Why doesn't GDPUtil work from this batch file?
Post by ahardesty on 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.



Title: Re: Why doesn't GDPUtil work from this batch file?
Post by Gert on 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

Title: Re: Why doesn't GDPUtil work from this batch file?
Post by ahardesty on Oct 12th, 2005 at 4:48pm
;) 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.

Title: Re: Why doesn't GDPUtil work from this batch file?
Post by Gert on 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

Title: Re: Why doesn't GDPUtil work from this batch file?
Post by ahardesty on 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[/code):
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[/code]
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.

Title: Re: Why doesn't GDPUtil work from this batch file?
Post by ahardesty on Oct 12th, 2005 at 5:16pm
AH HA   :D

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

What date/timestamp does gdputil look at when processing a -deleteolderthan?  Created, Modified, Accessed?

Title: Re: Why doesn't GDPUtil work from this batch file?
Post by Gert on 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

WatchDirectory Forum » Powered by YaBB 2.5.2!
YaBB Forum Software © 2000-2017. All Rights Reserved.