Monday, 18 October 2010

Backing up laptops on a network

As a recent post noted, Offline Files is still a temperamental technology that I have decided is not worth the effort on Windows 7. So what other systems can you use? Take note of the following:

  • By default, Windows 7 will create a restore point on the laptop’s hard drive every day. This can be used to retrieve a previous version of a file
  • Windows Backup can be used to make a backup of files onto an external HDD. However, it has very limited options, and I recommend considering the use of either an external disk with its own software, such as the Seagate Replica, or a third party program such as Karen’s Replicator from karenware.com
  • Commercial backup software such as MS DPM or Seagate BackupExec can have agents installed to automatically back up a laptop to a server, in conjunction with a server based installation of the software.
  • Robocopy can be run from a server to automatically back up using a script. In the rest of this article I will describe this option further.

Robocopy is a command line tool that has been available since the days of Windows NT and has been progressively refined since then. It is a powerful tool that we have used to do some of our backups up until now. There are many parameters and settings that can be used. The following is a list of these and how they are being used in the evaluation so far:

Source directory: typically \\%1\%2\%3\documents and \\%1\%2\%3\desktop are used (Robocopy is being invoked twice, once for each path). %1 is the Netbios name of the laptop. %2 is the sharename, %3 is the foldername within that share. Typically you will need to share the Users folder in Windows 7 or Documents and Settings in Windows XP, in which case %3 is also the Windows username of the user. To avoid visiting each laptop user, if you are the domain admin, use Computer Management to connect to each laptop in turn and then create this share. I use random strings of 20 characters followed by the $ sign to name each laptop share individually and keep it hidden. Grant Read permissions to Everyone on the new share. Windows file permissions will still prevent anyone other than the user and Administrators from accessing these files.

Target directory: Typically this might look like \\server\share\%3\backup\documents or \desktop depending on the source directory as above. This makes use of a target folder based on the username of the user, which is the same parameter as was used on the source directory.

Filespec: I recommend you create a settings.rcj file and use it with the /JOB:settings parameter. In the RCJ file you place the option /IF on a line by itself and then one filespec per line thereafter. At the moment this will look like:

/IF

*.do*

*.xl*

*.md*

*.acc*

*.pp*

*.pub*

which will pick up most Office files. Add, delete or change to suit.

Other options: /R:45000 /w:1 /B /FP /V /S /MIR /MT /TEE /LOG+:%3.log. Put the rest of these except the last (log) option into the RCJ file (one per line). Specify the log on the command line.

/R: /W: specify a retry option and wait between retries (in seconds). The settings shown wait for up to 12 hours. The recommendation would be to run this with Task Scheduler and get it to force termination at a lesser interval than the frequency you are running this on (e.g. 20 hours if you are running daily) and adjust the retry count as appropriate.

/B will try to use Backup mode if you don’t have the full file permissions set up for backup. /FP, /V and /TEE are logging settings. /S is for copying files in subdirectories. /MIR ensures that the backup mirrors the source. This option deletes files on the target if they are deleted from the source, so it isn’t the setting to use if you want to guard against file deletions. /MT makes Robocopy use multiple threads. /LOG is used to create a log file, the + option appends to an existing log file of the same name.

The actual calls to Robocopy are contained in our case in a Robobackup.cmd command script. I write an individual CMD file for each laptop and set up Task scheduler to start this, in the cmd script it makes the call to Robobackup.cmd passing in the parameters specified. The idea is one backup per day in a 12 hour window. But you could be more versatile and try for three backups each in a 4 hour window. I am still tweaking our test environment to see what we can do, and I expect a few different options will be tried out, and these might also include turning on Shadow Copies on the server where the backups are being stored to see if it will keep previous copies.

In the end I changed R and W to 0 and taskscheduled my task to run 12 times a day, every hour. This sounds like a lot and might well prove to be, but given that laptops will not be connected a lot of times, and that it will quit immediately if it is not, the amount of traffic probably won’t be as much as one would think. Another option is to trigger if the laptop is connected, but this requires a custom script or other means to detect connection (pinging would achieve this).

UPDATE:  Task Scheduler seems to have problems when it starts a command script that starts another command script that finally runs Robocopy. There also seem to be problems with a command script that has more than one command line in it.

After a lot of trial and error, therefore, my scheduled task is calling a cmd script that runs Robocopy directly using parameters that are passed into it. The task action passes four parameters into the command script that specify the laptop name, share name, username and folder for the source path. One of these also specifies part of the destination path, and another specifies another part of the destination path and the name of the log file. There are two task actions for each user, which arrange to back up the Desktop and Documents folders respectively. The common settings are passed in a .rcj file. There may be a fifth parameter to specify the rest of the destination path once I get my head around where these backups are going to be stored.

Saturday, 16 October 2010

Solving Group Policy deployment headaches in Windows 7

One of the most distasteful features of using Windows Vista and Windows 7 computers in a domain environment is their tendency to freeze during the Group Policy application phase of user logon. Although it is known that there were some instances of this occurring with Windows XP as well, we never saw these happen in our experience and first saw the problem in Windows Vista and Windows 7. The most common scenario for these problems is during the deployment of Group Policy Preferences for Printers. Extremely long timeouts going up to overnight in duration have been observed on some occasions, most commonly when a new computer is logged into for the first time. Although today I saw a laptop take a very long time to apply Folder Redirection policy, this is unusual whereas GPPP is the most common scenario by far. Even though event logging is greatly improved in Windows 7, there is still insufficient information recorded in the event logs for these instances. My latest effort is to get all the logging options turned on, both those specifically for GPPP logging and user environment processing, and hopefully with the logs now being produced routinely on all our computers we might get some progress towards resolving this matter. The fact that MS has failed to address this to date is a serious concern from my POV, even to the extent their logon processing should force the logon to continue after a reasonable period of time without these very excessive delays.

Windows Live Essentials gets a makeover

Well, Windows Live Essentials has been updated to the 2011 edition and they have, at last, gone back to proper toolbars with icons, replacing text labelled buttons in the last few editions. In fact, the WLE applications (I’m using Writer to post this) are now using the Ribbon like Office does, this is the first time I’ve seen another app from MS that uses the Ribbon. I would guess there are more buttons and options on the toolbars as well, which is partly necessary because the menu bar has disappeared. There is a Quick Access toolbar as well, just like in Office, except that you can only turn on or off the preset options; you can’t add to these just like you can’t customise the ribbon. Another feature copied from Outlook 2010 is the conversation view for email.

A new functionality in WLE is Mesh, which lets you sync a folder on your computer with another computer running Mesh, or with a 5 GB space in Windows Skydrive. The functionality provided is pretty restricted, it is just one folder and everything in that folder. An interesting additional Mesh functionality is that it provides for remote access to your computers from another computer, presumably they all have to have the same Windows Live ID and password configured on them.

One annoying WLM feature was the modal dialog it would put up to say it was changing message flags. It would do this every time you clicked on a new message, doing this was very slow as was changing the message status from unread to read. This seems to be a lot faster in WLM2011 and doesn’t need that dialog box displayed.