BACKING UP
by David Broughton
BACKING UP or ARCHIVING?
Backup: to guard against immediate or short term loss
of data.
Archiving: for long term historical records.
You may not always need archiving, but you will almost certainly
need backups.
The two can often be combined.
Don't forget that any backing up procedure has to have a corresponding
restoration procedure.
The restoration procedure must be practiced if not used to make
sure it works and to make sure you remember how to do it!
GOLDEN RULE ABOUT BACKING UP
BACKING UP WILL NOT GET DONE FREQUENTLY
ENOUGH IF THE PROCEDURE IS TOO LONG WINDED OR COMPLICATED
OR IF IT TAKES TOO LONG TO DO
|
The various MS-Windows operating systems do not make this task
easy. To be able to obey the above golden rule, I see no way
out other than using DOS facilities.
Backing up is mainly to another storage medium such as:
- Floppy disk
- High capacity floppy, such as LS-120
- Magnetic Tape
- Zip drive
- Compact Disk
- Removable hard disk
There are two kinds of file to be considered:
- Files with a unique name that will never be used again such
as the letter you have just written.
- Files such as a diary or a database that are continually
being updated.
In the latter case you must ask yourself:
| Am I happy to overwrite the previously backed
up files with the the latest versions? |
YES: go ahead and overwrite the old files. |
NO: you need, then, some system that will
avoid overwriting older copies. |
If you use the same file names on the same storage device, they
will overwrite the previous version. This does not guard against
inadvertent deletions being retrievable.
Also beware when overwriting that you may lose both copies if
a fault occurs whilst reading the new file.
If NO (the safer option), remedies are:
- Circulate the storage devices over two, three or more.
- Have an unending series, providing archives as well.
- Use different directories on the same device.
- Use different file names.
But beware against using the wrong floppy or CD, etc? How?
The system must not only be easy to do (one two two clicks with
the mouse or a few keyboard keys should be the norm) but to make
the process efficient (and therefore quick) do not allow files
that have not changed to overwrite their identical images on
the backup medium.
There are two ways to do this in DOS:
- Use XCOPY to copy only files with the archive bit
set.
- Use COPY with the Update switch.
File Attributes:
- Archive bit: Set when a change is made to the file.
- Read Only: Prevents changes or erasures.
- Hidden: Will not normally appear in listings.
- System: Hidden and required by the operating system.
Not so easy with Windows-only methods.
Of course, you don't back up all the Windows System files or
all the software -- only the changeable data. How to avoid this?
- Have an exclude list, with optional date.
- Have an include list.
But there are some awkward cases -- see below.
My System(s):
- I use LS-120 disks, but will soon change over to CD-RW.
- Unending sequence of disks, providing archives. I have found
this very valuable.
- Each disk has an identification file to make sure it is the
right one currently in use. This can be detected using batch
file conditional instructions.
- Important files (such as databases) are not allowed to overwrite
previous versions. I use a special program called COPYNNN that
makes a copy with a different file name extension.
- The whole procedure is in a batch file, invoked from a desktop
icon.
After nearly every computer session I just double-click the
backup icon and sit back for it all to happen (which is usually
not very much because only the changed files of that session
are copied to the back-up disk).
Restoration of files is easy also because I make sure that the
file structure on the backup disk is identical to the structure
on the hard disk.
I use an exclude list on my computer but I have also implemented
an include list system for my wife which works almost as well.
Awkward cases: These are the files that Windows keeps
updated rather than you. You have to know where they are and
what they are called and how to copy them. For example, the Windows
Address book and Outlook Express e-mail files. Windows programs
have a habit of "changing" files when they are not
changed, making the usual methods for detecting changes (by archive
bit or date/time) fail.
I handle these differently. E-mail files ("folders" in
OE speak) are in the exclude list and every month I make copies
(using COPYNNN) of those that have changed most into another
directory where the routine backup system will take care of them.
(This requires a restore procedure, to be explained).
The address book is another problem area but I have a separate
store and recall system for it that I do when I think about it
(not often enough).
Almost all my backup systems are controlled from DOS batch files
which can be very powerful with the new enhanced capabilities
in Windows XP. But I've only recently acquired XP. 4DOS still
is my favourite DOS enhancer but I still have to make special
programs of my own. These are:
COPYNNN: for making copies with different names.
LISTBAK: searches for all changed files (i.e. those with
their archive bit set), but excludes files and directories listed
in an exclude list and files older than a specified date. The
output is a list of files to be backed up.
BAKUP: This is the program that copies the files. It
creates the necessary path on the output medium for each of the
files listed by LISTBAK and checks first to see if an
older version of the file exists. If it does, it checks that
the new file is readable before making the copy (Why? Because
if it is not readable due to a disk error, a partial overwrite
of the old file will cause that to be unreadable as well, or
at least incomplete). It resets the archive bit on all successful
copies. (I originally used XCOPY for this job but found
bugs in it and it was not sufficiently versatile.)
ARCHIVE: (Not used by me -- this is used on my wife's
system) Checks for any file with its archive bit set in the current
directory. This is to avoid the tedium of placing lots of floppies
in drive A for each directory to be backed up when there is no
file to be backed up anyway. This method of backing up uses the
INCLUDE LIST method where a list of directories is made in a
batch file and each is checked for changes. With the ARCHIVE program,
the batch file rushes through very quickly if there is little
work to do and only the necessary disk changes are made. Since
using LS-120's, this is now less of a problem as many directories
can be stored on the same LS-120 -- unlike earlier days when
each directory had its own floppy disk.
Here is an example of a simple batch file that uses COPYNNN:
|