XXCLONE
[ Back to Table of Contents ] [ << ] [ >> ]

XXCOPY TECHNICAL BULLETIN #20


From:    Kan Yabumoto           tech@xxcopy.com
To:      XXCOPY user
Subject: More on Directory Cloning using XXCOPY
Date:    2000-10-31
===============================================================================

The topics included in this page were originally in the Disk Cloning
article XXTB #10.  Since most first-time visitors want to learn the simple
disk clone operation and tend to be in a hurry, I decided to do them
a favor by removing much of the variations and related materials from
the page and keep the other article focused on the disk clone case
only.  Here, a few variations which are related to the /CLONE switch
are discussed.


1.  Partial Disk cloning (bootable):

    This is a variation of the first one (Full Disk Cloning).
    It copies the minimum set of files into the new disk so that
    the new disk will become a bootable disk.  You may selectively
    add more directories and files if you want.  Here, the windows
    directory is assumed to be named C:\Windows (this is the default;
    but some people may call the windows directory C:\Win95, C:\Win98
    or whatever...)

    Batch file contents
    ----------------------------------------------------------
     XXCOPY C:\        D:\         /h/r/y/ks/zy
     XXCOPY C:\Windows D:\Windows  /h/r/y/ks/zy/e/i/xtemp*\
    ----------------------------------------------------------

      Explanation:

        /i    // initializes (creates if absent) the new directory
        /x    // excludes (in this case, directories starting "temp")

    This batch file works even when the destination volume is
    not empty.  It handles only the root directory (the top layer
    only without including all the subdirectories) in the first
    statement.  The second one will handle the entire windows
    directory.  The /xtemp*\ switch excludes all directories whose
    name starts "temp" in \Windows.  This eliminates the official
    windows temporary directory (C:\windows\temp\) and the hidden
    internet-related temporary directory used by Internet Explorer
    (C"\windows\Temporary Internet Files\).  You may add more
    exclusion items.

    Caution:

      The /CLONE, /Z, and /ZY switch performs deletion of extra
      directories and files in the destination.  If you inadvertently
      specify a wrong destination, the consequence will be very
      severe.  Some careless users have lost many files by this!!!

    Note that this script does not give you the absolute minimum
    set of files in the destination for Win9x.  It will contain many
    files that are not essential to the minimum Win9x.  Also note
    that an international (non-US) version of Windows may require
    additional language-specific files.


2.  Partial Disk cloning (bootable, even smaller):

    This is another variation of the second one with more strict
    selection of files (but not the absolute bare minimum).

    Batch file contents
    ----------------------------------------------------------------
     XXCOPY C:\                D:\                 /h/r/y/ks/zy
     XXCOPY C:\Windows         D:\Windows          /h/r/y/ks/zy/i
     XXCOPY C:\Windows\system  D:\Windows\system   /h/r/y/ks/zy/i
     XXCOPY C:\Windows\fonts   D:\Windows\fonts    /h/r/y/ks/zy/i
     XXCOPY C:\Windows\inf     D:\Windows\inf      /h/r/y/ks/zy/i
     XXCOPY C:\Windows\command D:\Windows\command  /h/r/y/ks/zy/i
    ----------------------------------------------------------------

    Note that this script does not give you the absolute minimum
    set of files in the destination for Win9x.  It will contain many
    files that are not essential to the minimum Win9x.  Also note
    that an international (non-US) version of Windows may require
    additional language-specific files.


3.  Backup to multiple removable media (floppy, CD-R, zip drive, tape)

    A very common headache in backup today is that none of our
    removable storage device such as the CD-R and Zip drive gives
    us a sufficient capacity for a full backup in one volume.
    Since most device drivers do not provide a volume-spanning
    capability, we are left without a decent solution.  Here's
    one way to do it using XXCOPY.  This technique is nothing
    new.  It is as old as XCOPY and the Archive attribute bit.
    The basic principle is described in our earlier article, XXTB #06.
    Here, in the following example the A: (floppy disk) drive is
    used the destination --- but let's not kid ourselves...

    Batch file contents
    ----------------------------------------------------------------
     XXCOPY C:\                /aa/h/s/q
     :looptop
     @echo.
     @echo  Insert a blank media and hit a key to continue
     @echo.
     @pause
     XXCOPY C:\   A:\          /m/h/r/y/ks/zy/s/q
     goto looptop
    ----------------------------------------------------------------

      Explanation:

        /aa  // sets the archive attribute bit (no copy takes place)
        /q   // quiet (reduces screen output on superfluous info)
        /m   // copies files with archive bit and clears the bit

     The first statement simply sets the archive bit on every file in
     the source directory.  Then, the batch file enters an infinite loop
     (from which you can exit only by typing Ctrl-C or Ctrl-Break)
     where you are asked to insert a new diskette (or whatever),
     and exactly the same XXCOPY command copies a diskette-full chunk
     at a time.  The trick here is the good old /M switch which clears
     the archive bit of as soon as a file is successfully copied to
     the destination.  It's not really a fancy technique but it works.

     This technique is not limited to a full backup.  You may choose
     a subdirectory and apply the same method (add the /i switch then).

     In a real life backup situation, I strongly suggest that you
     learn and use XXCOPY's /X and /EX switches in order to avoid
     files that do not need a backup.  Otherwise, you will end up
     creating a massive amount of backup data where most of the files
     are available on your CD-ROMs somewhere.

     As Microsoft's programmers bloat the Windows software and force
     us to buy ever increasing amount of hard disk space, the
     percentage of user-generated data is declining in most computer
     systems.  Therefore, we need to be clever and more selective in
     setting up the backup script.


If you have a nifty batch file using XXCOPY and want to share with
other XXCOPY users, please let us know.  We may publish good ones.

Please send E-Mail to <tech@xxcopy.com>.



© Copyright 2016 Pixelab All rights reserved.

[ XXCOPY Home ] [ Table of Contents ] [ << ] [ >> ]

Join the XXCOPY group