Solved

XCOPY and AT

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

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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
DHCP restore question Server 2003 to 2012 3 59
DHCP server 6 68
How to set IPSec under Server 2008 R2 and Server 2012 R2 3 69
windows Server 2003 in 2017 10 110
The HP utility "HP Lights-Out Online Configuration Utility for Windows Server 2003/2008" could be of great use when it comes to remotely configure a HP servers ILO WITHOUT rebooting the server. We would only need to create and run scripts using thi…
I've always wanted to allow a user to have a printer no matter where they login. The steps below will show you how to achieve just that. In this Article I'll show how to deploy printers automatically with group policy and then using security fil…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

734 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