Backing up Users in Windows XP
Robert Moore, DCC Psychology
This doc focuses on easy ways for users of Windows XP to do their own backup. This means that the backup may be thought of as being under user control, even if initiated as a scheduled task. Schemes where the backup is initiated remotely as part of some central process, and as part of the computing infrastructure, are not considered here.
Today I was talking with a grad student whose lab computer had stopped running the SAS analysis program. It required an enormous amount of cleaning, stripping out ad and spy ware, registry editing of mutiple installs of different versions of the same software and on and on. The student mentioned that in a top level directory called SAS were files that were, in essence, her entire academic life. About 500 MB of them. When I asked about backup she told me that she had burned a CD some months before. That's not a backup. First thing - copy her files immediately to a department server.
One of our faculty, Heather Bradshaw, used to say "There were two kinds of computer users. Those who had lost a lot of data and those who are going to."
There are numerous considerations in backing up user files on XP boxes. The two main ones are: - Backup to what? A server? A tape? Another drive in the same computer? - What software to use?
BACKUP TO WHAT
- Add a 2nd hard drive to the same computer - Add a 2nd hard drive to a different computer - Use an existing server Never make the mistake of backing up files from, for example, drive C to drive D if both are logical partitons of the same physical volume. It is not unusual to find a drive partitioned this way. With older operating systems this is used to deal with logical drive size limitations. With newer systems you will sometimes find the entire Documents and Settings structure on logical drive D.
It is possible to use a local tape drive which usually ships with specialized software. Remote tape drives are most often found as part of a dedicated system with software such as Retrospect ©.
When you automate tasks to copy files from one volume to another (local or remote), great care must be made in assigning or changing drive mappings. If you are trying to copy to drive H and today it is mapped as drive J it is not going to work.
WHAT SOFTWARE TO USE
BACKUP: You can use the GUI utility BACKUP to backup files or folders to a file or tape. The utility is also used to restores files or folders from a file or tape. Look in All Programs - Accessories - System Tools - Backup The utility is also capable of backing up state data, that is, registry, boot files, and the Active Directory directory service database.
Usually one schedules a full backup (F) on one day of the week and an incremental backup (I) on all other days. So that you wind up with a increasingly large file that goes FIIIIIIFIIIIIIFIIIIIIFIIIIII . . . The advantage is you can find a version of a file as it existed on Tuesday, even though it was edited and saved on Thursday. The usual problem is that the backup file will eventually fill the entire backup drive. At that point, you need to off-load the backup file. Or if you have room for the next full backup, rename the existing file, for example, from MYBU to OLDMYBU and then delete OLDMYBU after the full backup has run and the file MYBU created. Never just simply delete the backup file to make room. Never.
Alternatively, you can use the ntbackup component of the backup utility at the command line or in batch files. ntbackup cannot be used to restore files or folders.
XCOPY: You can write a simple batch file in an ASCII editor (e.g., Notepad) to use the XCOPY command to backup files from one drive to another. (Shades of DOS !!!) Note that the target drive could be a local drive or a mapped drive on another Windows box or on the Novell server. You can schedule this file to run automatically every night using the task manager. Automated backup. Free.
There is a tendency to think of XCOPY as an old (archaic?) DOS command but in fact it has been enhanced in Windows XP. For example, you can copy encrypted files from an NTFS volume to a FAT volume, decrypting them on the fly. There are many (many) command parameters and details. You should go to Help and Support under the Start menu to get complete documentation.
An example: Using XCOPY one can back up the entire Directories and Settings folder from one drive to another, overwriting only files with newer dates. If you think about this, it is a special sort of incremental backup. It is an incremental backup laid over a full backup. You only have access to the latest version of any backed up file. But if you delete a file from the source drive after is has been backed up, it will still appear in the backup file.
Here is a batch file that backs up user usr1 from C to D. The first time it runs, everything will be copied. The next time it runs, only files whose source time is newer than the destination time will be copied, overwriting those earlier files. Note the use of the exclude parameter so that not everything in the user's documents and settings folder is backed up.
REM This is file BUc2d.bat xcopy "c:\Documents and Settings\usr1\*.*" "d:\Documents and Settings\usr1\*.*" /d/s/e/c/r/h/y/exclude:usr1ex.txt
This example uses the following parameters
| /d:m-d-y | Copies files changed on or after the specified date. If no date is given, copies only those files whose source time is newer than the destination time. |
| /s | Copies directories and subdirectories except empty ones. |
| /e | Including empty subdirectories. |
| /c | Continues copying even if errors occur.*1 |
| /r | Copies read-only files. |
| /h | Copies files with hidden and system file attributes. By default, xcopy does not copy hidden or system files. |
| /y | Suppresses prompting to confirm you want to overwrite an existing file. |
| /exclude:usr1ex.txt | Excludes files listed in the file usr1ex.txt *2 Here is an example exclude file: C:\Documents and Settings\usr1\ntuser.dat C:\Documents and Settings\usr1\Application Data\ C:\Documents and Settings\usr1\Local Settings\ C:\Documents and Settings\usr1\NetHood\ C:\Documents and Settings\usr1\PrintHood\ C:\Documents and Settings\usr1\Recent C:\Documents and Settings\usr1\SendTo |
*1 Note that the attempt to copy certain files such as ntuser.dat will not be carried out as the file is considered to be in use by another program (the OS) and will issue a "Sharing Violation" warning message. That is to be expected. The /c paramenter allows the backup to continue. Optionally, one can use the /exclude parameter (as here) to construct lists of files that will not be copied.
*2 You can use any file name. It is best to have all the files used to control the backup at the same level. My preference is to put them in the volume's root. That makes setting paths much easier . . .