Solved

Why doesn't this Scheduled backup task work?

Posted on 2004-09-09
7
158 Views
Last Modified: 2010-04-14
If i enter the following into COPY.CMD and then register this CMD into
the Schedule Task list I see it run & it exits immediately with error code 4.
Can anyone explain why?

File COPY.CMD
==========
echo "Delete target directories"
del /F /S /Q w:\*.*
echo "Copy Over"
xcopy f:\foo w:\foo /s /Y
xcopy f:\goo w:\goo /s /Y
xcopy f:\hoo w:\hoo /s /Y


The above was run under the Administrator account, F is the local machine, W is
a drive mounted on a separate machine on a local network.

Is it having a problem with the *.* list, there are quite a few files involved.
0
Comment
Question by:nicksbell
  • 4
  • 2
7 Comments
 
LVL 17

Expert Comment

by:Eagle6990
ID: 12021977
What happens if you manually run the file from a command line? You might be able to see more of what is going on.
Are you trying to delete just the file or the directories as well? If you want to delete the directories then you need to use the rd command.
0
 
LVL 2

Author Comment

by:nicksbell
ID: 12022642
Sorry, i should have mentioned that, i can run the CMD file just fine on its own, it is only
when run from the scheduler that it has the problem
0
 
LVL 17

Expert Comment

by:Eagle6990
ID: 12022733
I would start rem'ing everything out, or maybe rem out everything and see if it can run then. if it can't, then you know it is an issue with your schedule.  Gradually work it back until you find out exactly which line is causing your error.
0
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 
LVL 16

Expert Comment

by:glenn_1984
ID: 12023240
The Task Scheduler needs a user name AND password to work.
You may add it to the Task Properties.

Then right click on the task and Run to test
0
 
LVL 2

Author Comment

by:nicksbell
ID: 12025989

So, i investigated this some more. It seems to be related to the W drive. If i try and use the
same sort of CMD file to just delete (no xcopy) a file on the local C drive it works.

But if i try and delete the same file when it is on the shared W drive it fails!
0
 
LVL 17

Accepted Solution

by:
Eagle6990 earned 75 total points
ID: 12026857
Sounds like a permissions issue.  Don't know for sure, but one thing you could try is to dismount the W: drive in your batch file and then remount it before attempting to delete so it is created with the same permissions the batch file has.  Try the "net use" command to remove and add a mapped drive.
0
 
LVL 17

Expert Comment

by:Eagle6990
ID: 12028534
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
In this article we will learn how to backup a VMware farm using Nakivo Backup & Replication. In this tutorial we will install the software on a Windows 2012 R2 Server.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

773 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