Jump to content

Recommended Posts

Posted

Hello folks

 

Due to severall reasons, I have to copy, at regualr intervals,

severall thousand from server (or PC) A to server B.

 

I've been using a batch file with a simple "xcopy *.*" command but,

usually, either the scheduler fails or the command itself aborts for

some reason or another. I usually end up having to manually copy the

files 2-3 times per week...

 

Does anyone have a better idea on how to do this? Some basic backup

system, or utility? Any idea?

 

Thanks for any help

  • Replies 11
  • Created
  • Last Reply

Popular Days

Guest Lanwench [MVP - Exchange]
Posted

Re: Mass copy of files: how to?

 

JR <not@mine.mn> wrote:

> Hello folks

>

> Due to severall reasons, I have to copy, at regualr intervals,

> severall thousand from server (or PC) A to server B.

>

> I've been using a batch file with a simple "xcopy *.*" command but,

> usually, either the scheduler fails or the command itself aborts for

> some reason or another. I usually end up having to manually copy the

> files 2-3 times per week...

>

> Does anyone have a better idea on how to do this? Some basic backup

> system, or utility? Any idea?

>

> Thanks for any help

 

I use robocopy & a batch file for this sort of thing all the time. You can

have it write to a log, as well.

Posted

Re: Mass copy of files: how to?

 

On Sun, 20 Apr 2008 09:47:44 -0400, "Lanwench [MVP - Exchange]"

<lanwench@heybuddy.donotsendme.unsolicitedmailatyahoo.com> wrote:

 

>

>I use robocopy & a batch file for this sort of thing all the time. You can

>have it write to a log, as well.

 

Robocopy?...

Guest Pegasus \(MVP\)
Posted

Re: Mass copy of files: how to?

 

 

"JR" <not@mine.mn> wrote in message

news:3snm04p4nvn91sqbm854quqmf9u1jaj7u2@4ax.com...

> On Sun, 20 Apr 2008 09:47:44 -0400, "Lanwench [MVP - Exchange]"

> <lanwench@heybuddy.donotsendme.unsolicitedmailatyahoo.com> wrote:

>

>

>>

>>I use robocopy & a batch file for this sort of thing all the time. You can

>>have it write to a log, as well.

>

> Robocopy?...

 

You can download robocopy.exe from some Microsoft site.

Note that it won't necessarily solve your problems. You did

not tell us why xcopy fails - it may do so due to problems

that will not be resolved when using a different command.

Posted

Re: Mass copy of files: how to?

 

>>

>> Robocopy?...

>

>You can download robocopy.exe from some Microsoft site.

>Note that it won't necessarily solve your problems. You did

>not tell us why xcopy fails - it may do so due to problems

>that will not be resolved when using a different command.

>

 

Just saw robocopy thanks. However I'd like to avoid Windows scheduler

and line commands completely.

 

Tbh, I haven't been to really understand the problem. Sometimes the

batch file simply doesn't run at the scheduled hour; other times, the

copy simply stops midway...

Guest Pegasus \(MVP\)
Posted

Re: Mass copy of files: how to?

 

 

"JR" <not@mine.mn> wrote in message

news:htpm04lje7ho6uv721tngbkcb0rrlgiub9@4ax.com...

>

>>>

>>> Robocopy?...

>>

>>You can download robocopy.exe from some Microsoft site.

>>Note that it won't necessarily solve your problems. You did

>>not tell us why xcopy fails - it may do so due to problems

>>that will not be resolved when using a different command.

>>

>

> Just saw robocopy thanks. However I'd like to avoid Windows scheduler

> and line commands completely.

>

> Tbh, I haven't been to really understand the problem. Sometimes the

> batch file simply doesn't run at the scheduled hour; other times, the

> copy simply stops midway...

 

It is up to you if you want to use the Task Scheduler or not. If you

don't use it then you have to initiate the copy process manually.

 

Avoiding "command lines" means that you have to perform the

copy action in a GUI environment. You cannot reliably automate

this. Seeing that you need to run the copy process several times

each day, I do not think that a GUI is a viable option.

 

Batch files are as reliable as you make them. If properly written

then they work each and every time. Furthermore, they provide

full error reporting. So far you appear to have paid no attention

to error messages, hence you do not know why xcopy.exe failed.

As a server administrator you cannot afford to do this.

 

If you specify your requirements then someone will be able to

suggest a reliable batch file solution based on robocopy.exe.

You could even arrange it so that you get an EMail on completion

of the copy process, informing you about its success or failure

(which would be nice when using the Task Scheduler).

Guest leew [MVP]
Posted

Re: Mass copy of files: how to?

 

Pegasus (MVP) wrote:

> "JR" <not@mine.mn> wrote in message

> news:htpm04lje7ho6uv721tngbkcb0rrlgiub9@4ax.com...

>>>> Robocopy?...

>>> You can download robocopy.exe from some Microsoft site.

>>> Note that it won't necessarily solve your problems. You did

>>> not tell us why xcopy fails - it may do so due to problems

>>> that will not be resolved when using a different command.

>>>

>> Just saw robocopy thanks. However I'd like to avoid Windows scheduler

>> and line commands completely.

>>

>> Tbh, I haven't been to really understand the problem. Sometimes the

>> batch file simply doesn't run at the scheduled hour; other times, the

>> copy simply stops midway...

>

> It is up to you if you want to use the Task Scheduler or not. If you

> don't use it then you have to initiate the copy process manually.

>

> Avoiding "command lines" means that you have to perform the

> copy action in a GUI environment. You cannot reliably automate

> this. Seeing that you need to run the copy process several times

> each day, I do not think that a GUI is a viable option.

>

> Batch files are as reliable as you make them. If properly written

> then they work each and every time. Furthermore, they provide

> full error reporting. So far you appear to have paid no attention

> to error messages, hence you do not know why xcopy.exe failed.

> As a server administrator you cannot afford to do this.

>

> If you specify your requirements then someone will be able to

> suggest a reliable batch file solution based on robocopy.exe.

> You could even arrange it so that you get an EMail on completion

> of the copy process, informing you about its success or failure

> (which would be nice when using the Task Scheduler).

>

>

 

While using the task scheduler is optional and you can find 3rd party

apps that will do the same, I have not had any unresolvable problems

using it for scheduling on my systmes.

 

And I agree that really, a command line tool is the best option (at

least that I'm aware of and since it works so well, I wouldn't be

looking for another).

 

A VERY brief tutorial on how to do this - use a batch file where you

redirect the output to log files - for example, even using xcopy right

now, you can simply append "output.log 2>&1" (without the quotes) and

"see" all that you would see if you run the command manually (see it by

opening the output.log file created after each copy). Further, if you

are failing in your copies now, I would expect you are not using

appropriate XCOPY switches to continue on errors. It might even be that

a network problem is disconnecting the drive which would mean problems

that don't involve the program you use.

 

Lastly, if these two machines ARE servers, you might want to look into

using Windows Server built in file replication features to keep the data

updated. For example, DFS.

Posted

Re: Mass copy of files: how to?

 

 

 

The commands I use are:

x: original localtion

Y: final location

 

xcopy x: y: /e /y

 

 

Copies are made from severall destinations (PCs and servers) to a

server

 

 

Sometimes the copy simply stops, and there is NO error message on

event viewer...

Guest leew [MVP]
Posted

Re: Mass copy of files: how to?

 

JR wrote:

>

> The commands I use are:

> x: original localtion

> Y: final location

>

> xcopy x: y: /e /y

>

>

> Copies are made from severall destinations (PCs and servers) to a

> server

>

>

> Sometimes the copy simply stops, and there is NO error message on

> event viewer...

 

There wouldn't be - there wouldn't be an event logged for the command

line.

 

Instead, try using (without the quotes):

 

"copy /e /c /h /o /v /y x:*.* y:

>xcopy-%date:~-4%%date:~4,2%%date:~7,2%-%time::=%.log 2>&1"

 

and see what happens. For reference:

 

/E - Copies directories and subdirectories, including empty ones,

assuming you want to maintain the entire directory structure.

/C - Continues copying even if errors occur. Good to do but make sure

you create the log so you see what might have been missed.

/H - Copies hidden and system files also.

/O - Copies file ownership and ACL information, assuming you need to

preserve file ownership information.

/V - Verifies each new file.

/Y - Suppresses prompting to confirm you want to overwrite an

existing destination file.

 

Then a log file will be created based on the date and time the command

was run (there is a possibility that this log file won't work if you are

not in the USA and doing things based on certain default US time/date

settings on the system).

 

Then open the log file and see what has happened.

Guest Pegasus \(MVP\)
Posted

Re: Mass copy of files: how to?

 

 

"leew [MVP]" <useContactPage@LWComputing.dot.com> wrote in message

news:480b8593$0$11612$607ed4bc@cv.net...

> JR wrote:

>>

>> The commands I use are:

>> x: original localtion

>> Y: final location

>>

>> xcopy x: y: /e /y

>>

>>

>> Copies are made from severall destinations (PCs and servers) to a

>> server

>>

>>

>> Sometimes the copy simply stops, and there is NO error message on

>> event viewer...

>

> There wouldn't be - there wouldn't be an event logged for the command

> line.

>

> Instead, try using (without the quotes):

>

> "copy /e /c /h /o /v /y x:*.* y:

 

The "copy" command does not know most of these switches.

I think you meant "xcopy".

 

Furthermore, if the command is to be robust then the OP

must specify the source and target folders, e.g. like so:

xcopy /e /c /h /o /v /y x:\*.* y\:

 

Omitting them *assumes* that they are what the OP expects,

which is likely to cause problems.

Guest Pegasus \(MVP\)
Posted

Re: Mass copy of files: how to?

 

 

"JR" <not@mine.mn> wrote in message

news:53um049gaqa9mvlb9g489mi2k00054o428@4ax.com...

>

>

> The commands I use are:

> x: original localtion

> Y: final location

>

> xcopy x: y: /e /y

>

>

> Copies are made from severall destinations (PCs and servers) to a

> server

>

>

> Sometimes the copy simply stops, and there is NO error message on

> event viewer...

 

Further to leew's reply, I recommend that you add some logging

facilities, e.g. like so:

@echo off

echo %date% %time% > c:\xcopy.log

xcopy /e /c /h /o /v /y x:\*.* y:\ 1>>c:\xcopy.log 2>>&1

 

Examine c:\xcopy.log to find out three things:

- When the command last executed.

- What it copied.

- Why it failed (if it failed).

Posted

Re: Mass copy of files: how to?

 

Ok folks thanks for the help


×
×
  • Create New...