Solved

XCOPY and AT

Posted on 2006-11-28
3
734 Views
Last Modified: 2008-02-01
Howdy.

I'm using XCOPY in a batch file and AT to schedule nightly backups on a Win2k3 Storage Server.  I'm having a problem and am seeing the following stuff in the log:

"At2.job" (Tuesday.bat)
      Finished 11/28/2006 2:15:00 AM
      Result: The task completed with an exit code of (1).

I also see an exit code of (4)


I know these error codes are less than informative.  Does anyone have any idea what might be happening?  I've done this on other Win2k server machines without error.

If not - how bout a cheap/free alternative to AT or it's GUI equivalent.

TIA
0
Comment
Question by:ttist25
3 Comments
 
LVL 83

Accepted Solution

by:
oBdA earned 500 total points
ID: 18035361
The task scheduler can't do miracles; the at command just starts the script, it doesn't know what the script does. You have to log what you're doing in the batch file to find out what's not working there.
You can create the log file by redirecting the command output. The output redirection for the xcopy command in the following example, '>>"%LogFile%" 2>&1', will redirect the standard output (>>"%LogFile%") as well as the standard error output (2>&1 redirects stderr to stdout) to the logfile.

@echo off
setlocal
set LogFile=C:\Temp\scheduled-task.log
if exist "%LogFile%" del "%LogFile%"
>>"%LogFile%" echo Task started: %Date% %Time%
xcopy ... >>"%LogFile%" 2>&1
>>"%LogFile%" echo Task ended: %Date% %Time%
0
 
LVL 10

Expert Comment

by:SeanUK777
ID: 18039367
have a look a robocopy.exe, as it was designed for Windows 2003 as an improvment to xcopy..

Its part of the 2003 Res Kit

Download it here:

http://www.microsoft.com/downloads/details.aspx?displaylang=en&familyid=9D467A69-57FF-4AE7-96EE-B18C4790CFFD
0
 
LVL 1

Author Comment

by:ttist25
ID: 18115300
Sorry for taking so long to get back on this.  It's certainly been a crazy few weeks.  

Anyway - the LogFile thing worked exceptionally well.  I was able to see that I'm getting an invalid drive specification error.  Drives are mapped via Group Policy which occurs at login.  I'm assuming that since I am not logged in when the batch file runs this is the reason for the error.

Today I'll do a "manual" mapping of these drives and see if that takes care of it.

Again - excellent advice.  It worked like a charm.

THANKS!  
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Scenerio: You have a server running Server 2003 and have applied a retail pack of Terminal Server Licenses.  You want to change servers or your server has crashed and you need to reapply the Terminal Server Licenses. When you enter the 16-digit lic…
A quick step-by-step overview of installing and configuring Carbonite Server Backup.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now