Solved

Robocopy - Backup data from mutiple computers using list and batch file

Posted on 2012-04-03
4
411 Views
Last Modified: 2012-04-08
Hey guys,

I have been trying to develop a script to backup the Win XP "Documents and Settings" directory on computers in a pilot group we are getting ready to deploy Windows 7 to.

We have informed them to back up their own data and only doing this as a fail safe. I am not getting very far with this script and to be honest am at the end of a development phase that I can't think straight after. This is what I have so far. If someone could help me complete it I'd really appreciate it.

for /f  %%a in (PCList.txt) do (
md \\<serverpath>\%%a\
)
for /f  %%C in (PCList.txt) do (
   robocopy "\\%%C\C$\Documents and Settings\" ^
 \\<serverpath>\%%C\ /MIR /W:1 /R:1 ^
 /LOG+:"\\<serverpath>\%%C\%%C.log" ^
 /XD "\\%%C\C$\Documents and Settings\Administrator" ^
 "\\%%C\C$\Documents and Settings\Default User" ^
 "\\%%C\C$\Documents and Settings\All Users" ^
 "\\%%C\C$\Documents and Settings\%username%"
)

Open in new window


Cheers
G_M
0
Comment
Question by:G_M
[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
  • 2
4 Comments
 
LVL 5

Assisted Solution

by:2Cs
2Cs earned 500 total points
ID: 37800410
This is the script I use to backup folders on demand:

echo on Replication Starting..........


:########################
:Clear all mapped drives#
:########################

net use * /d /y


:###################################
:Mapping of Replication directories#
:###################################

net use i: \\Server\Share
net use l: \\Server\Share
net use u: \\Server\Share
net use y: \\Server\Share
net use t: \\Server\Share
net use o: \\Server\Share$

:#########################
:Replication of - Web#
:#########################

robocopy i:\Webserver z:\Webserver /e /copy:DAT /R:2 /W:2


:#########################
:Replication of - DC02#
:#########################

robocopy \\Server\Documentation$ z:\Server\Documentation /e /copy:DAT /R:2 /W:2

robocopy \\Server\Users z:\Server\Users /e /copy:DAT /R:2 /W:2


:#############################
:Replication of - Server#
:#############################

robocopy y: z:\Server\Share /e /copy:DAT /R:2 /W:2


:########################
:Clear all mapped drives#
:########################

net use * /d /y

Open in new window


A list of switches and commands can be found here:

http://ss64.com/nt/robocopy.html
0
 
LVL 54

Expert Comment

by:Bill Prew
ID: 37800595
That doesn't look unreasonable, what problem(s) are you having?

~bp
0
 

Accepted Solution

by:
G_M earned 0 total points
ID: 37800622
The link that 2Cs sent pointed out an error in the source and destination paths

If either the source or desination are a "quoted long foldername" do not include a trailing backslash as this will be treated as an escape character, i.e. "C:\some path\" will fail but "C:\some path\\" or "C:\some path\." or "C:\some path" will work.

for /f  %%a in (PCList.txt) do (
md \\<serverpath>\%%a\
)
for /f  %%C in (PCList.txt) do (
   robocopy "\\%%C\C$\Documents and Settings" ^
 "\\<serverpath>\%%C" /MIR /W:1 /R:1 ^
 /LOG+:"\\<serverpath>\%%C\%%C.log" ^
 /XD "\\%%C\C$\Documents and Settings\Administrator" ^
 "\\%%C\C$\Documents and Settings\Default User" ^
 "\\%%C\C$\Documents and Settings\All Users" ^
 "\\%%C\C$\Documents and Settings\%username%"
)

Open in new window


Thanks for the link.

Cheers
G_M
0
 

Author Closing Comment

by:G_M
ID: 37820820
The link provided had comprehensive information about the tool I was using
0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
There are many software programs on offer that will claim to magically speed up your computer. The best advice I can give you is to avoid them like the plague, because they will often cause far more problems than they solve. Try some of these "do it…
This Micro Tutorial will teach you how to change your appearance and customize your Windows 7 interface to your unique preference. This will be demonstrated using Windows 7 operating system.
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

752 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