Avatar of YellowbusTeam
YellowbusTeam

asked on 

Using Task Scheduller to run Robocopy Scripts

Hi Guys,

We have a Server 2008 Standard edition server running service pack 2 (this is not R2).

We use Robocopy to backup data from the server to a NAS box over night, this is setup to run via a Windows Schedulled task. When it runs over night we get the following error (0x41306), this result is returned for all out Schedulled tasks that we have on the server.

If we try to run the Schedulled tasks by clicking run, it all apears to work... but it doesnt as there is no mapped drive appearing in windows explorer for the NAS box.

If we run the Robocopy script on its own and not through the Schedulled taks it runs fine and we dont get anyy errors (if a little slow).

Any help on this would be greatly appreciated?

Windows Server 2008

Avatar of undefined
Last Comment
RyanShafer
SOLUTION
Avatar of RyanShafer
RyanShafer
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of Darius Ghassem
Darius Ghassem
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of YellowbusTeam
YellowbusTeam

ASKER

The Robocopy script runs whitout any issues when you run it manually on the server. It maps the network drive on the NAS box and then backups all data to that drive letter.

It is a specific issue within task schedullar when it comes to execute robocopy... as it returns (0x41306) when it has supposedly finished its job.
Avatar of YellowbusTeam
YellowbusTeam

ASKER

Sorry yes i should of stated Robocoy batch file not Robocopy script.

for example we have daily.bat, week1.bat and so on for the batch files and the schedulled taks follow on occordingly.
Create another batch file that calls up the daily.bat and week.bat see if this fixes the problem.
Avatar of YellowbusTeam
YellowbusTeam

ASKER

i have created a batch file to call the original batch file and ammended the schedulled task. i have run the batch file to check all is working and it is. I have run the schedulled task and it is showing a status of running but how do i know it is definetly working??
Check to see if files are getting copied.
Avatar of YellowbusTeam
YellowbusTeam

ASKER

Ah Yes it appears to be copying files... Although it seems to be at snales pace...
That has nothing to do with the actual schedule task not running.
Avatar of YellowbusTeam
YellowbusTeam

ASKER

Yes i know.
I will see what the end result is tomorrow as there is a large volume of filess to be copied accross.
Avatar of RyanShafer
RyanShafer
Flag of United States of America image

Please use /LOG and post the log that is created.  It will tell you what was transfered or not and also how long, avg speed etc, thanks
Ok but the Schedule task problem is fixed, right? And the batch file calling up the other batch file fixed the problem
Avatar of YellowbusTeam
YellowbusTeam

ASKER

ok...
I have checked the schedulled task this morning and we a seeing a last run result of (0x8004131F), anybody know what this means??

I have checked the files and it appears to have copied data accross but it is still running at this moment at time.
Means schedule task is already running

SCHED_E_ALREADY_RUNNING
0x8004131F

http://msdn.microsoft.com/en-us/library/aa383604(v=vs.85).aspx

Avatar of RyanShafer
RyanShafer
Flag of United States of America image

Where are you trying to copy the data, because to me it sound like you are trying to copy it over a very slow link and it is giving you fits.
Avatar of YellowbusTeam
YellowbusTeam

ASKER

We are trying to copy data from our DC server to a Netgear NAS box over the LAN.

How come you no longer get the command line screen like you used to do when you run a schedulled task on a 2003 server?

Ta
Avatar of RyanShafer
RyanShafer
Flag of United States of America image

If you schedule a .bat to run your robocopy script you can add the /TEE switch in order to log the copy and also to have a command prompt where you can monitor the status while the transfer is taking place.  You will notice after a couple copies that most files are skipped and that the transfer does not take nearly as long.
Avatar of YellowbusTeam
YellowbusTeam

ASKER

is the /TEE switch at the end of the line where you would place /w:2 ans so on??
Avatar of RyanShafer
RyanShafer
Flag of United States of America image

Correct

example:

robocopy.exe <source> <destination> /e /DATS /r:3 /w:1 /TEE /LOG:<logfile_name>
Windows Server 2008
Windows Server 2008

Windows Server 2008 and Windows Server 2008 R2, based on the Microsoft Vista codebase, is the last 32-bit server operating system released by Microsoft. It has a number of versions, including including Foundation, Standard, Enterprise, Datacenter, Web, HPC Server, Itanium and Storage; new features included server core installation and Hyper-V.

86K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo