Welcome, Guest. Please Login or Register.
watchDirectory Support Forum watchDirectory Home Page
Contact us
Blog (deutscher Blog)
Download
Sep 9th, 2010, 2:08am
News: New Add-On for WatchDirectory and WatchFTP: The Remote Control Center
 


Pages: 1
Why doesn't GDPUtil work from this batch file? (Read 1185 times)
ahardesty
YaBB Newbies
*


I love YaBB 1G -
SP1!

Posts: 8
Why doesn't GDPUtil work from this batch file?
Oct 12th, 2005, 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
 


 
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 Moderator
*****




Posts: 1365
Re: Why doesn't GDPUtil work from this batch file?
Reply #1 - Oct 12th, 2005, 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
Did you see our blog with tips & tricks?
http://watchdirftp.blogspot.com/
WWW   IP Logged
ahardesty
YaBB Newbies
*


I love YaBB 1G -
SP1!

Posts: 8
Re: Why doesn't GDPUtil work from this batch file?
Reply #2 - Oct 12th, 2005, 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 Moderator
*****




Posts: 1365
Re: Why doesn't GDPUtil work from this batch file?
Reply #3 - Oct 12th, 2005, 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
Did you see our blog with tips & tricks?
http://watchdirftp.blogspot.com/
WWW   IP Logged
ahardesty
YaBB Newbies
*


I love YaBB 1G -
SP1!

Posts: 8
Re: Why doesn't GDPUtil work from this batch file?
Reply #4 - Oct 12th, 2005, 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
*


I love YaBB 1G -
SP1!

Posts: 8
Re: Why doesn't GDPUtil work from this batch file?
Reply #5 - Oct 12th, 2005, 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 Moderator
*****




Posts: 1365
Re: Why doesn't GDPUtil work from this batch file?
Reply #6 - Oct 12th, 2005, 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
Did you see our blog with tips & tricks?
http://watchdirftp.blogspot.com/
WWW   IP Logged
Pages: 1