consultancy chorley ASP.NET Server Side Scripting Wigan
Website Development Radcliffe

A Coder's Notes

Email :
bespoke invoice systems Standish Information Technology Advice Worsley
    development systems Ramsbottom
data manipulation Farnworth access databases Whitefield SQL connections Atherton
online accessible software Leyland software compatible Coppull

Get connected and Online Tottington
remote management Makerfield code and design Aspull

Backing Up - The Joy of Robocopy - 11/10/2010

One of the jobs I decided to sort out at Leisuredrive was the backups. 

Backing up is a complex issue for lots of companies, and it really need not be so.  The ultimate aim is to have at least one, preferably 2 or 3 copies of the original data.  Just because a PC has worked fine for the last 2 or 20 years does not mean it's going to work well tomorrow.  Leisuredrive only have 3 computers, so this makes my job easier.

PC 1 - The MD's.  All I've done here is share out the MD's folder in Documents and Setting.  If you've ever tried copying a whole user's folder you amy know that certain files, such as NTUSER.DAT, will not transfer.  This is because they are system file which windows holds on tightly to.  But in a backup they are unimportant.  It's the real data that matters, the user's pictures, documents, emails and so on.  Most of this, if not all of it, is spread around the user's folder under Documents and Settings.

Robocopy is a great help as it can be configured to retry files say only once or twice.  It can actually be configured not to retry at all, but it's good to have a couple of retry's just in case.  So when robocopy tries to copy the NTUSER.DAT file or any other files in use, it errors out but tries again, errors out then moves onto the next file.  Use "/R:2 /W:2", which means retry twice, wait for 2 seconds inbetween

This way now I have the whole user's folder.  There's an aful lot of data in there, most of it irrelevant, but with data storage being cheap it's not an issue.  Robocopy can also be configured to only update CHANGES withing the folder.  This means the initial copy may take some time but after that a backup may only take 5 minutes, even with 14gig of data!  Use "/MIR" which means mirror.  Be warned, it also deletes files that have been removed from the master.

PC 2 - Admin.  This is an easy one.  All the admin work is carried out using my wonderful online stock control programme I have developed for Leisuredrive.  There's nothing to backup on the PC.  It's the future you know.

Apple 1.  I never knew...Apple Mac's can share folders over the network.  Just like PC1 I've shared the user's folder and back that up using robocopy.

My PC.  Robocopy the user's files...again.

So where am I backing all this data up to?  A big fancy RAID NAS?  Offsite to the Cloud?  Nope.  I have 2 160 gig external USB hard drives.  I robocopy the data to the drives, then one remains at the Leisuredrive office in the safe, the other comes home with me.

It doesn't have to be complicated or expensive you know.

Cheers, Ren.

Post A Comment

Name Comment
Matt what happens when robocopy corrupts the ntuser.dat file thereby rendering the profile next to useless? A 3,000kb file gets reduced to 256kb, where does the information go and how do i fix it? Especially when you have 150 computers and over 300 users?
Matt I was wondering if you have any ideas about why robocopy would corrupt the ntuser.dat file on a network? Or is it the ntuser.dat file that is making robocopy break, or is there something wrong with the registry? Users log in and everything is fine, they log out, then log back in and their account is jacked. No email, web browsing…it is as if they log into a default temp file with no permissions other than to log in. The problem is when they log out those settings corrupt their roaming profile and then it follows them where ever they log in forcing us to find and delete the local profile at every computer they have been corrupted on then delete their roaming profile so it refreshes itself. We’ve tried router configs, switch configs, duplex settings, registry edits, and nothing works. We also tried reimaging every computer on the domain with a “perfect” (as far as we could tell) image. Also, the corrupt ntuser.dat file is ALWAYS 256kb, never more or less after it gets corrupt, even if it started out at 1500kb. Any ideas? Matt
Ren Hi Matt. I don't know what's happening with your ntuser.dat files. Here's what I'd do... I assume you're using robocopy to try and back up a user's roaming profile? In which case...don't use robocopy for a few days...does the problem continue? In which case there's a problem with the whole domain's roaming profile system somewhere. If the roaming profiles work happily when robocopy IS NOT being used, then that points to robocopy being the problem. I don't use domains and roaming profiles myself, I deal with small businesses and setting up an active directory for 5 users is a waste of time and energy. Robocopy on a non-domain, local profile PC just tries to move ntuser.dat and then bombs out and tries again. I just make sure robocopy is set to only try once or twice, not the default 8 trillion times (or whatever). BUT you're using roaming profiles. Are you trying to robocopy the profile on the domain server or from the user's machine? In which case it seems IF IF IF robocopy is causing the problem then it's likely to be robocopy grabbing the file during a moment it's not being used, then the machine tries to use it at the same time and 2 programs trying to open one file will cause all kinds of weirdness. You may want to research "shadow copy" on the internet.
programming services specialist
Valid XHTML 1.0 Transitional