Solved

Noobish backup with xcopy script question

Posted on 2006-10-21
13
244 Views
Last Modified: 2010-03-19
Hi,

So we are backing up all users in our business office to a network hard drive. We are just backing up my documents and their desktop. I plan on using xcopy, however I dont want to customize the script for each user.

Here is what I have basically now:


xcopy "C:\Documents and Settings\Jdoe\Desktop" F:\Jdoe\

Is there a way to make USERNAME automatically be input based upon which user is logged in. Like say Jdoe was backing up it would look like this:

F would be a mapped network drive which i guess brings up a good point as well. I will have to create a folder for each user on the backup device, is there a way to automate this process?

Thanks,
Chad
0
Comment
Question by:ItsChad
[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
  • 5
  • 5
  • 2
  • +1
13 Comments
 
LVL 39

Accepted Solution

by:
redseatechnologies earned 500 total points
ID: 17782489
Hi ItsChad,

I would be inclined to use robocopy for this instead of xcopy - either way, the following would work

robocopy (or xcopy) "C:\documents and settings\%username%\desktop" F:\%username%

Hope that helps,

-red
0
 

Author Comment

by:ItsChad
ID: 17782494
Well I am guessing I could go:
xcopy "C:\Documents and Settings\%username%\Desktop" F:\%username%\

Hmm, I also now am wondering if I will have to go in and manually change permissions for each folder created?

0
 

Author Comment

by:ItsChad
ID: 17782499
Thanks for the help red, yeah I figured this part out, looking at an old script I wrote. The first time they ran the file it would create the folder on the backup drive with their username right? However I would have to manually change permissions correct?

Thanks,
Chad
0
Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

 
LVL 39

Expert Comment

by:redseatechnologies
ID: 17782508
The folder would have permissions for the creator and for the administrators by default (i am pretty sure)

As long as the users have permissions to create folders in F:\ it should be fine

-red
0
 
LVL 95

Expert Comment

by:Lee W, MVP
ID: 17782513
Sounds ok... so what are you doing for an offsite backup?  In case of fire... or worse...
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 17782790
BTW I would suggest using "%userprofile%\%username%\desktop" rather than hard coding a path - that assumes it is running as that user.

Are you aware of roaming profiles BTW, or redirection of my documents and desktop to a network drive using group policy?

Both are possibly more difficult to setup but are more robust as users data would be on the server stright away - then again maybe you don't have a domain / server as such?
0
 

Author Comment

by:ItsChad
ID: 17783684
Well here is the reasoning behind what we are doing it the way we are. Alot of users feel better working off their local machine than they do having their information stored on the server. So as a matter of comfort we are wanting it to be stored locally then it also helps us by having a good backup source that would be easy to use in case of a single file being corrupted.

I am unfamiliar with %userprofile%\%username%\my documents would that work?


Thanks for all the info.

Chad
0
 

Author Comment

by:ItsChad
ID: 17783688
Also the computers we are doign this on, are single user machines. So that saves alot of confusion.

Thanks,
Chad
0
 
LVL 39

Expert Comment

by:redseatechnologies
ID: 17783696
All you would need to do is "%userprofile%\my documents" not "%userprofile%\%username%\my documents"

And I agree with you, My Documents redirection is buggy, and has all kinds of problems when users connect to another LAN.

Personally, I configure a robocopy script that is scheduled to run from the server twice a day, and give the users the same kind of this on their desktop so they can do it manually - they are doing quite well with that level of control, and we are problem free so far

-red
0
 

Author Comment

by:ItsChad
ID: 17784110
Thanks for all your help red. I am not familar with robocopy, much like xcopy?
0
 
LVL 39

Expert Comment

by:redseatechnologies
ID: 17784896
Similar, but much more powerful, robocopy pretty much supersedes xcopy

http://www.ss64.com/nt/robocopyXP.html

-red
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 17784989
Agreed, do use robocopy if you can, much better than xcopy -- take a look at the /MIR switch, ideal for such backups as it will keep the two copies of data in sync.

Sorry for mis-entered path before, %userprofile% take you to c:\documents and settings\username or wherever the profile is stored on a particular computer so it is correct the my documents *SHOULD* be under that.

Personally I have never had any problems with folder redirection for My Documents and Desktop to keep them seperate from Roaming profiles stored elsewhere, perhaps combined with Offline Files facility as long as the place it is redirected to exists... but a scripted method is as good, or better in a lot of ways.

Steve
0
 
LVL 39

Expert Comment

by:redseatechnologies
ID: 17786102
Yeah, I didn't have problems with My Documents redirection, up until recently.

Two users (different clients) both of which have home networks.  When they connected to the home networks, instead of wireless, something went nuts and they lost their local copy.

Since then, I am a bit sour on the whole thing, so have been using robocopy, which is not ideal, but makes me feel better about it

-red
0

Featured Post

Don't miss ATEN at NAB Show April 24-27!

Visit ATEN at NAB Show to learn how our "Seamlessly Entertaining" solutions deliver fast, precise video streaming without delays for the broadcasting and media environment. ATEN will showcase its 16x16 Modular Matrix Switch (VM1600) and KVM Over IP Solution (KE6900 series).

Question has a verified solution.

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

Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
For many of us, the  holiday season kindles the natural urge to give back to our friends, family members and communities. While it's easy for friends to notice the impact of such deeds, understanding the contributions of businesses and enterprises i…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

763 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