I have a cmd file that is executed every morning at 2:59:59 in Windows 2003 Server Task Scheduler. It runs, taking about 20 minutes to complete its tasks. If I run it manually from the command line, it runs without error. The automated run in Task Scheduler, however, finishes with an Exit Code of (1).
The task list is fairly simple: I delete all files in about 12 folders on three network drives, and copy about 500 files from a production system into those same folders. The idea is to get the production system backed up to three network locations, so we always have yesterday's data available.
I've entered my own Active Directory credentials in the scheduler to ''backup as'' myself (admin), and following deletion, am using the UNC convention to copy out the files, following this format:
COPY CPU982ADMINADMINNEWACCTGPAYROLL*.ASC BHAM-ENG-DATASHAREGLOBALJJANSKYRBaseSandboxPAYROLL /V /Y
Here is the result with the error code:
''Backup RBase.job'' (BackupRBase.cmd)
Started 3/4/2009 3:00:00 AM
''Backup RBase.job'' (BackupRBase.cmd)
Finished 3/4/2009 3:20:23 AM
Result: The task completed with an exit code of (1).
You can see, it took 20 minutes and 23 seconds to run, so it IS doing something, but the error code concerns me. I'm finding little help in a google search.
Comments:
Mar 05, 2009
- frcs,
No joy. I walked through the file line by line. These are just simple "DOS" copy commands - copy path\filename newpath\filename /v /y
I found no anomolies. It all looks very uniform since there are scores of identical lines row after row, with the only difference being the filename extensions.
I also tried changing the UNC path to the mapped drive name. Last night's run still resulted in an exit code of (1).
Any thoughts on where to take this?
Mar 06, 2009
- Hmmmmmm, that's a heck of a thought. Let me change it to an 8.3 filename and see if that fixes the issue. I'll letcha know.
Mar 10, 2009
- Still no joy. So, today, I meticulously walked through lines of this file. I did find one whack "/' that was supposed to be an escape character, but was butted up against the end of the path statement, so it may have been the cause of the issue. The process will run again at 3AM tomorrow. I'll post the results here.