Solved

XCOPY and AT

Posted on 2006-11-28
3
736 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Organizations create, modify, and maintain huge amounts of data to help their businesses earn money and generally function.  Typically every network user within an organization has a bit of disk space to store in process items and personal files.   …
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

815 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

8 Experts available now in Live!

Get 1:1 Help Now