Solved

XCOPY and AT

Posted on 2006-11-28
3
739 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 85

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:Seelan Naidoo
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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

I guess it is not common knowledge to most Wintel engineers/administrators: If you have an SNMP-based monitoring system in your environment (and it's common to have SNMP or Syslog) it's reasonably easy to enable monitoring of the Windows Event logs,…
Learn about cloud computing and its benefits for small business owners.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

623 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