BACKDASD UTILITY
----------------

Version 1.00

(c) Steve Sharrad, August 1996.
(c) The HENLEY College, August 1996.

It is suggested that you make this window full-screen,
if it is not already, by double-clicking on the above title bar.


All rights reserved.

This software is supplied without any warranty whatsoever and is used
entirely at the users own risk. No claims for damages as a result of using
this product will be accepted.

This product may be freely copied on the understanding of the above and on the
basis that it is not modified or sold for profit, and that it is supplied with
the readme text files (such as this document).

1.      Introduction and Aim
2.      Features
3.      Syntax
4.      Notes
5.      Problems
6.      Suggestion on how to incorporate DASD limits


1.      Introduction and Aim
----------------------------


386 HPFS provides the capability to limit the amount of disk space DASD resources take up.
This is especially useful where a large number of users share a limited amount of space.
However, as particular users demands change, you may find that you alter the limits associated
with these resources occassionally.

If, however, you needed to restore your system from tape (if, for example, you had suffered
a harddisk failure) then you would get all your data back, and probably all of your access control
lists (ACLs, if you were using an OS/2 backup program which restored directory information, such
as OS/2 Warp Server's Personally Safe'n'Sound, or Sytron's Sytos).

However, none of these programs, as yet, backup or restore the directory limit information.
In some cases this is not important, but if you have a large number of users or limited diskpace
(which may soon disappear before you can get all the limits back on at the right size) then this
could be a problem.

BACKDASD solves this problem by backing up directory limit information for DASD resources.
It backs up limit size, threshold value and delta, all into an editable text file. This
information can then be restored at a later time by the reverse process, RESTDASD.

Not only does this help you to get your system back up and running in an emergency (because
you won't have to worry about details such as DASD limits) but it also gives you the flexibility
to allow you to have different directories having different DASD limits without you having to
continually make a note of any changes.

BACKDASD is run from the command line (from within an OS/2 full-screen or Window). It can be run
manually, or for peace of mind, it can be included as part of an AT schedule.


2.      Features
----------------


BACKDASD has the following features:

a)      Remote backup

BACKDASD can back up directories or disks on remote servers. You don't have to have an
administrator logged on (or to be logged on at all) to perform a local backup but you must be
logged on as a domain administrator to backup remote servers.

b)      Error Log

BACKDASD maintains a comprehensive log. If you include BACKDASD as part of an AT schedule, then
you can ask BACKDASD to write an entry into the log upon succussfully completion. You can then
check this log later to check that BACKDASD completed successfully.

BACKDASD performs many error checks and these errors are displayed to screen and copied to the
log file. You can, if you want, turn off error reporting (not recommended).

c)      Speed Optimization

BACKDASD contains three backup engines which are used by BACKDASD as and when appropiate.
For example, imaging your directory strutcure starts something like this:


C:\


 C:\IBMCOM
       
 C:\IBMLAN
       
 C:\OS/2
       
 C:\USERS
  
   C:\USER1
  
  
   C:\USER2
    
     IBMWORKS
    
     ULTIMOTION


DASD limits control the size of the resoure but also the size of any resources below them.
If you simply want to make sure that the tree under C:\USERS does not grow too large, then 
you could only apply a limit to C:\USERS. In this case, you would use BACKDASD in non-recursive
mode.

To make BACKDASD backup all sub-dirctories, then use BACKDASD in recursive mode (default).

If you had limits applied to the USER1, USER2.. directories (but not to the other sub-directories
below each of these directories) then to save BACKDASD searching through all subdirectories, then
use BACKDASD in recursive mode 2. This means that BACKDASD will backup DASD information for the 
C:\USERS directory and for C:\USER1 and C:\USER2 but not for any of the sub-directories coming
off C:\USER1 or C:\USER2. In effect, BACKDASD is being recursive but to only one level down. This 
can save backup time on very large disks with many directories. For recursive mode 2, you will 
need to be logged on as an administrator to backup a remote server.



3.      Syntax
--------------

Go into the directory containing the BACKDASD utility. This will be the place you asked for
during INSTALL.

Typing BACKDASD /? provides the following information:


BACKDASD Version 1.00beta   Release 04/08/96 (c) Steve Sharrad.
Internet e-mail: ssha@henleycol.ac.uk

Backs up DASD directory limits on 386-HPFS DASD-enabled volumes.
BACKDASD backs up all DASD information for a specified path into
a backup file. You can then use RESTDASD to restore this file.

The syntax of this command is:
BACKDASD /F:[filename] /P:[pathname] [/R:[value]] [/L:[filename]] [/S:\\[servern
ame]] [[/E]] [[/C]] [[/V]] [[/T]]

Required Parameters: /F:[filename]      Specify a filename to backup to
					Default extension is .DSD
		     /P:[pathname]      Specify the pathname/tree to backup
Optional Parameters: /R:[value]         Specify 0 to turn off recursive backup
					Specify 1 (default) to backup all sub-
					directories, or 2 to backup only sub-
					directories upto 1 level down.
		     /L:[filename]      Specify a different errorlog filename
					Defaults to \DASD.LOG
		     /S:\\[server]      Specify a valid server on domain. If
					used, then pathname must be on server
		     /E                 Turns-off the error logging to file
		     /C                 Displays info and asks for confirmation
		     /V                 Displays information during process
		     /T                 Write the operation time and backup
					count to error log upon completion


/F:[filename]
-------------

Use this parameter to specify a file to backup to. If you don't specify an extension, then
.DSD is assumed. If the file already exists a backup copy will be made.

You should put a fully qualified pathname in front of the filename.


/P:[pathname]
-------------

Specify the tree to backup. If you want to backup a whole drive, then specify the root, e.g.

		/P:C:\. 

If you want to backup a tree which has a space character in the filename, then encapsulate the
pathname in quotes, e.g.

		/P:"C:\USERS RULE"



The following parameters are optional.

/R:[value]
----------

Use this switch to change the recursive mode. The modes are as follows:

0               Backs up the directory specified by the /P: switch but no sub-directories
1 (default)     Backs up all sub-directories. Could take some time on large disks.
2               Backs up sub-directories but only down to one level. Saves time on large disks.


/L:[filename]
-------------

Use this switch to specify an alternative location and name for the log file.


/S:\\[servername]
-----------------


Defaults to the local workstation.

Use this switch to specify the servername to backup. This can be any running server on the same
domain (specifying the local workstation name does not fool BACKDASD and makes no difference).

Note that if you use this switch then the pathname pointed to by /P: must be a real pathname
on the specified server. You cannot backup re-directed resources directly; you must use the /S:\\
switch.


/E
--

Stops any entries being written to the error log.

/C
--

Make BACKDASD display information on what it is about to do and ask for confirmation before it
actually does it.


/V
--

Make BACKDASD report verbosely during the backup.


/T
--

Make BACKDASD make entry into error log upon successfull completion of task.



4.      Notes
-------------


Drives must be enabled for DASD limits before any limits can be applied. 
This is dones by using NET DASD [drivename] /ENABLE and restarting the workstation.

You must be logged on as an administrator to backup a remote server.

If the /S:\\ switch is used, then the pathname must be on the remote server.



Creating an AT schedule:

OS/2 prompt

AT 20.00 /EVERY:M,T,W,TH,F,S BACKDASD /F:c:\backup\cdrive.dsd /p:c:\ /l:c:\ibmlan\logs\dasd.log /t

This creates an AT schedule which runs at 8.00pm every evening of the week
except Sunday. It calls BACKDASD and backs up all DASD limits on the C drive.
The file is stored in C:\BACKUP. Logging is to a file in C:\IBMLAN\LOGS. BACKDASD
also writes to the error log upon completion so that this file can be checked to
make sure the backup went OK.

Ideally, instead of calling BACKDASD, the AT scheduler should call a batch
file which calls BACKDASD, then BACKACC (if needed) and then your tape
backup software. Note that if you wish to use BACKDASD from another .CMD batch file, then the CALL command must be used
otherwise when BACKDASD finishes it will not return back to the calling .CMD file.

Note that BACKDASD can return error codes back to the calling process if the /V
switch is used. If you are using the AT command, then do not use the /V switch; you won't see any 
information anyway but the /V switch causes the whole of the calling process indicated by
the AT command to be aborted (if BACKDASD encounters an error and returns an error code).

If you have a large number of DASD limits below a path (in excess of 1000) then it is possible
that BACKDASD will report error BACKDASD 0005: Insufficient stack space.

This can be cured by editing the BACKDASD program file and increasing the buffersize value at the
top of the file. I've never exhausted the buffer because I've set it quite high, but if you do
get this error then BACKDASD will report an estimate of what it thinks it should be set to.


Maximum Backup Size

In fully recursive mode, BACKDASD can back up upto about 1,600 DASD limits (depending on the length of the directory names).
You will find that BACKDASD fails if there are more limits to be backup up but BACKDASD runs out of memory, and returns error 14.
You have two options:

i)      Use Recursive Mode 2. If all of your DASD limits are user home directories one-level down off a main tree, then use /R:2.
ii)     Use normal mode but split the backup into several main trees.
iii)    Increase the amount of memory BACKDASD is allowed to use. Make a backup copy of the BACKDASD.CMD file, and then open    it using the E editor. On the first page you will notice a value called DASDInfo.Buffersize.
	The value is in bytes. The default value is 6018000. Increase the value inside the inverted commas to allow BACKDASD    to use more memory.

Default:        DASDInfo.BufferSize='6018000'

	Note that if you specify a value ludicrously high, then BACKDASD uses a smaller value and even less is backed up.

5.      Problems
----------------


There are no known problems with the software. However, if you do come across a problem, please
make a note of the following after trying again:

- The version of BACKDASD you are using
- The command line options you gave to BACKDASD
- The configuration of your computer
- Any error numbers or exitcodes
- BACKDASD contains an in-built freak error handler. This will provide a few lines of debug
  information which you should also record


Send details via e-mail to ssha@henleycol.ac.uk. If possible, send also a copy of the DASD
error log and any partially created backup files and a listing of your directory structure.
No fixes guarunteed!

There are two limitations with the current release of BACKDASD:
- You cannot call BACKDASD from another intelligent REXX script unless ADDRESS is used. You can use the CALL command to invoke BACKDASD from a normal .CMD batch file, however.

- Maximum size of buffer; this can be increased if needed by user.


6.      Suggestion on how to incorporate DASD limits.
----------------------------------------------------

You can add or modify DASD limits by either using the Drives utility in the
OS/2 System Folder (OS/2 3.0 only), or by the NET DASD command, or by using the
SETDASD program (supplied with this program).

For help with the command line, read the Network Administrators Guide.

If you using a REXX batch file to make your user accounts, then you
could make a version of this file which includes a NET DASD add
statement which operates on the users home directory as the user account
is created.

You can also set the threshold of when warnings are sent out as the resource begins to fill up
and how often warnings are sent out after then.


