[dba-Tech] Security measures

John Colby jcolby at colbyconsulting.com
Thu Aug 28 08:58:43 CDT 2003


RE: [dba-Tech] Security measuresJon,

Open a dos box.
Type in xcopy /? to get a list of all switches.

C:\>xcopy /?
Copies files and directory trees.

XCOPY source [destination] [/A | /M] [/D[:date]] [/P] [/S [/E]] [/V] [/W]
                           [/C] [/I] [/Q] [/F] [/L] [/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.  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.
  /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.

Therefore the switches I use: /E /Y /C /M /I

mean:

Copy directories and sub directories
Suppress prompt to copy over existing file
Continue copy even if error occurs (file open for example)
***
Copy only files with the archive attribute - turn off attribute

THIS is the one that handles copying only the changed files.  When any
program is opened, Windows sets the archive attribute to denote that it has
changed.  This switch says only copy the files with the archive attribute
set (have changed) and then CLEAR that attribute (say the file has been
backed up)
***
Assume destination is a directory

This process is VERY fast using disk-disk on the same machine.  Since only
changed files get copied I never have to worry about work being lost.  It is
fast enough that you could probably even set it up to do it once an hour if
you were really paranoid.

I have a UPS for every machine with a cable going to the machine and
software installed telling the machine that power has failed and the machine
needs to close windows gracefully  if the power is off for more than about 2
minutes.  This works well so I don't need to worry about power outages
corrupting things on me.  My "Backup on the cheap" handles my DATA backup
pretty much without a hitch.
John W. Colby
www.colbyconsulting.com

  -----Original Message-----
  From: dba-tech-bounces at databaseadvisors.com
[mailto:dba-tech-bounces at databaseadvisors.com]On Behalf Of Jon Tydda
  Sent: Thursday, August 28, 2003 8:37 AM
  To: 'Discussion of Hardware and Software issues'
  Subject: RE: [dba-Tech] Security measures


  John

  That's inspired... What do all the individual switches mean? I've only got
a vague memory of DOS I'm afraid :-)



  Jon

  -----Original Message-----
  From: John Colby [mailto:jcolby at colbyconsulting.com]
  Sent: 28 August 2003 13:37
  To: Discussion of Hardware and Software issues
  Subject: RE: [dba-Tech] Security measures



  BTW, I generated a batch file that copies all of the CHANGED files from a
given path to another path.  I then run that from my windows scheduler once
a day.

  The batch file looks like:

  xcopy d:\dev e:\Backup\dev /E /Y /C /M /I
  xcopy d:\C2DbClientBilling e:\Backup\C2DbClientBilling /E /Y /C /M /I
xcopy d:\Clients e:\Backup\Clients /E /Y /C /M /I xcopy d:\COLBYCONSULTING
e:\Backup\COLBYCONSULTING /E /Y /C /M /I xcopy d:\ColbyConsultingWebNew
e:\Backup\ColbyConsultingWebNew /E /Y /C /M /I xcopy d:\NVFCNew
e:\Backup\NVFCNew /E /Y /C /M /I xcopy d:\Projects e:\Backup\Projects /E /Y
/C /M /I xcopy "c:\dOCUMENTS AND SETTINGS" "e:\Backup\documents and
settings" /E /Y /C /M /I

  As you can see, I am simply doing an XCopy from my D:\Dev to e:\Backup.
This copies the entire directory the first time.  The switches cause the
copy to only copy CHANGED files, thus the second and subsequent times the
xcopy is darned fast.  However if I create a new client directory in my dev

  (development) directory, it is automatically backed up.  In this case, the
  E: drive is a second physical drive in the same machine.  However there is
no reason why it couldn't be a mapped drive on a completely different
machine, or for that matter even a ftp up to a directory on the net if I
wanted to pay for disk storage out there.

  I call this "backup on the cheap"

  John W. Colby
  www.colbyconsulting.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://databaseadvisors.com/pipermail/dba-tech/attachments/20030828/850d72e8/attachment.html>


More information about the dba-Tech mailing list