Re: How can I easily back up to an external hard drive?

From: LVTravel (none_at_nothere.com)
Date: 08/25/04


Date: Wed, 25 Aug 2004 13:28:45 -0400

Easiest way to do this is to create a batch file and use the XCOPY command
to copy the full directory(folder) to the USB drive. I backup my desktops
and server regularly this way.
-------------------------------
XCopy copies files and directory trees.

XCOPY source [destination] [/A | /M] [/D[:date]] [/P] [/S [/E]] [/V] [/W]
                           [/C] [/I] [/Q] [/F] [/L] [/G] [/H] [/R] [/T] [/U]
                           [/K] [/N] [/O] [/X] [/Y] [/-Y] [/Z]
                           [/EXCLUDE:file1[+file2][+file3]...]

  source Specifies the file(s) to copy.
  destination Specifies the location and/or name of new files.
  /A Copies only files with the archive attribute set,
               doesn't change the attribute.
  /M Copies only files with the archive attribute set,
               turns off the archive attribute.
  /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.
  /EXCLUDE:file1[+file2][+file3]...
               Specifies a list of files containing strings. Each string
               should be in a separate line in the files. When any of the
               strings match any part of the absolute path of the file to be
               copied, that file will be excluded from being copied. For
               example, specifying a string like \obj\ or .obj will exclude
               all files underneath the directory obj or all files with the
               .obj extension respectively.
  /P Prompts you before creating each destination file.
  /S Copies directories and subdirectories except empty ones.
  /E Copies directories and subdirectories, including empty ones.
               Same as /S /E. May be used to modify /T.
  /V Verifies each new file.
  /W Prompts you to press a key before copying.
  /C Continues copying even if errors occur.
  /I If destination does not exist and copying more than one file,
               assumes that destination must be a directory.
  /Q Does not display file names while copying.
  /F Displays full source and destination file names while
copying.
  /L Displays files that would be copied.
  /G Allows the copying of encrypted files to destination that
does
               not support encryption.
  /H Copies hidden and system files also.
  /R Overwrites read-only files.
  /T Creates directory structure, but does not copy files. Does
not
               include empty directories or subdirectories. /T /E includes
               empty directories and subdirectories.
  /U Copies only files that already exist in destination.
  /K Copies attributes. Normal Xcopy will reset read-only
attributes.
  /N Copies using the generated short names.
  /O Copies file ownership and ACL information.
  /X Copies file audit settings (implies /O).
  /Y Suppresses prompting to confirm you want to overwrite an
               existing destination file.
  /-Y Causes prompting to confirm you want to overwrite an
               existing destination file.
  /Z Copies networked files in restartable mode.

The switch /Y may be preset in the COPYCMD environment variable.
This may be overridden with /-Y on the command line.
-------------------------------
The batch file should be a text only file (use notepad.exe to create) and
named filename.bat where filename is the name of the file desired.
It should contain the command/s:

XCOPY "C:\DOCUMENTS AND SETTINGS\LOGIN-NAME\FOLDER-NAME\*.*" X:\LOGIN-NAME
/E /I /G H /R /C /Y

X: = USB drive's drive letter. Login-name is the name showing in the
Documents & Settings folder that you use to sign in with. This will create
a folder and subfolders on your USB drive and copy the entire contents of
the Documents & Settings folder for the login person to the USB drive even
if errors are encountered.

The last line of the batch file should be EXIT on a line by itself. This
will close the DOS box (even though it should close automatically anyhow.)

My batch file to backup my primary desktop to my server's backup drive is:

@ECHO OFF
XCOPY "C:\DOCUMENTS AND SETTINGS\MYNAME\FAVORITES\*.*" V:\FAVORITES /E /I /G
/H /R /C /Y
XCOPY "C:\DOCUMENTS AND SETTINGS\MYNAME\DESKTOP\*.* V:\DESKTOP /E /I /G /H
/R /C /Y
XCOPY C:\DOWNLOAD\*.* V:\DOWNLOAD /E /I /G /H /R /C /Y
XCOPY C:\FONTS\*.* V:\FONTS /E /I /G /H /R /C /Y
XCOPY C:\WINDOWS\FONTS\*.* V:\FONTS /E /I /G /H /R /C /Y
XCOPY D:\GRAPHICS\*.* V:\GRAPHICS /E /I /G /H /R /C /Y
EXIT

You will notice that some of the paths are enclosed in quotes and others are
not. DOS does not recognize spaces in filenames unless the full path is
enclosed in quotes. Since I don't save anything locally on my computer
except for downloads and graphics copied from my digital camera (I read and
write from the network's server) I don't have to copy the entire Documents &
Settings folder to the backup, only the information that is changed
regularly. I also have a similar method of copying data files on my server
from one drive to another drive.

I then use scheduler to run the batch files automatically each night.

"easypilot" <easypilot@discussions.microsoft.com> wrote in message
news:7EEFF5D9-A01D-4D7D-8202-2D543D9004CC@microsoft.com...
> I purchased and successfully installed an ACOM 80gb external hard drive to
> back up my internal desktop 40gb drive. I have a T4150 Emachines running
XP
> at 1.5gHz. The new drive comes pre-formatted with a FAT32 Partition. I
could
> not copy XP files containing encrypted data, so I re-formatted to the NTFS
> file system. The drive is connected via a high speed USB port. ACOM
> instructions recommends using "copy and paste" to backup my primary drive.
> The problem now is that even though all applications are not running and
only
> the desktop "My Computer" is used for copy and paste, certain files used
by
> XP are either open or cannot be copied and pasted. The entire paste
command
> shuts down when this file is encountered. When I try to copy and paste one
> folder at a time, I can zero in on the offending file and ultimately skip
> over it, but this method is so time consuming (over 4 hours). Can anyone
tell
> me how to quickly back up my internal drive without having to sit and
monitor
> the process? A bootable external drive would be nice but not really
needed,
> as I can boot after a physical failure with my XP Restore CD. I really
don't
> care how long the backup takes. I just want it to continue without halting
> and don't want to monitor a lengthy process. Thank you for any reply or
> consideration.