Need Help to write a script that copy files

BZNUSER
BZNUSER used Ask the Experts™
on
Hi, i need help to write batch file script that copy files from 20 different computer to Log server.
i want to copy all my files form \\computer1\Log\ , \Computer2\Log\, Computer3\Log\ ...
to central location \\LogServer\Logs\ .
I want that this script will run / scheduled every day, 1st time that this script run it will copy all files from computer to LogServer & in another day's it will copy just new files [something like incremental backup].
please HELP
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
What operating system to you run on the Log server?

Commented:
You can do this easy with robocopy.
http://technet.microsoft.com/en-us/library/cc733145(WS.10).aspx

robocopy \\computer1\Log\ \\logserver\logs\computer1

Author

Commented:
I use Microsoft Windows XP on all computers,
how can i use robocopy & if exist ?
can some one write an example >?
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

the coment from fqrehl says it all. There nothing more to it than just that.
Well, there is a bit more to it than that.  Robocopy can be used, but is not installed by default on Windows xp, so you'll have to download that first:

http://www.microsoft.com/downloads/details.aspx?familyid=9d467a69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en

Then you can write a batch file that uses robocopy for all the servers you wanted:


robocopy \\computer1\Log\ \\logserver\logs\computer1
robocopy \\computer2\Log\ \\logserver\logs\computer2
etc...

and then when you've written the batch file you can call it from Windows task scheduler to run every day.

Commented:
You do not need "if exist". It uses incremental copy automatically.

Author

Commented:
Hi,
10xs to all - i succeed write my 1st robocopy batch file,
I am using /Log:logfile.txt switch,
and my question is :
How can i send the log's by e-mail?
i want to receive log files of robocopy by e-mail?
or better option is get just logs with errors?
please assist
You can use a command line email client to send the logs by email from within your batch file.  I've use sendmail successfully in the past (http://www.sendmail.org/) but others have recommended blat (http://www.blat.net/).

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial