1 DISKCHARGE
 Diskcharge is used to assign an account or charge number to a disk
 file or files. It is also used to display the account numbers on
 files in a directory (or directory tree), replace existing charge
 numbers with a new one, and display current summary usage. 

 System Management uses the program to generate summary files for
 entry into a VAX Resource Accounting System. During
 initial setup, and subsequently when the System Manager records
 usage, un-tagged files will be set to the account number specified
 in the user's authorization record in SYSUAF. See "Default Account"

2 /REPLACE
 Invokes DISKCHARGE to replace one account or charge number with
 another.
 
  Format:
 
        DISKCHARGE/REPLACE/OLDACCOUNT=oldacc/ACCOUNT=acc file-spec
 
3 Parameters
    file-spec
 
    Specifies the name of the file or directory tree which is to
    be processed.
 
    Wild card characters are allowed in the file specification which
    defaults to *.*;*
 
3 Command_Qualifiers
 
/ACCOUNT
 
 /ACCOUNT=account_number

 Specifies the new charge number which is to be assigned to the file.
 The charge number must be valid, and the user must be authorized to
 charge it, or currently be running with OPER privilege. 

 /ACCOUNT and /PROJECT are synonyms.
 
/DEFAULT
 
 /DEFAULT
 Specifies that the account number from the file owner's entry in
 SYSUAF be used as the replacement account. User must have sufficient
 privilege to use this option (i.e., either be the file's owner, or be
 in the same group as the file's owner and have GRPPRV, or SYSPRV,
 etc.)
 
/LOG
 
 /LOG
 Log results to the terminal or output file.

/OLDACCOUNT
 
 /OLDACCOUNT=account_number
 Specifies the account number which is to be replaced. This qualifier
 must be supplied. The only wildcarding permitted is "*" which says to
 replace ANY existing account with the new account. 

 /OLDACCOUNT and /OLDPROJECT are synonyms.
 
/OLDPROJECT

 /OLDPROJECT=account_number
 Specifies the account number which is to be replaced. This qualifier
 must be supplied. The only wildcarding permitted is "*" which says
 to replace ANY existing account with the new account.
 
 /OLDACCOUNT and /OLDPROJECT are synonyms.
 
/OUTPUT
 
 /OUTPUT[=file-spec]
 
 Specifies the output file.  If you omit  the /OUTPUT qualifier,
 output is directed to SYS$OUTPUT.
 
 
/PROJECT
 
 /PROJECT=account_number
 
 Specifies the new charge number which is to be assigned to the file.
 The charge number must be valid, and the user must be authorized to
 charge it, or currently be running with OPER privilege. 

 /ACCOUNT and /PROJECT are synonyms.
  
3 Examples

  $ DISKCHARGE/REPLACE/OLDACCOUNT=AB1234/ACCOUNT=AB4567 [XYZ]*.TXT;*

 	For all files ending in .TXT in directory [XYZ] with the
 	existing account number AB1234, replace the account number 
 	with AB4567.

  $ DISKCHARGE/REPLACE/OLDACCOUNT=*/ACCOUNT=AB4567 [XYZ]*.TXT;*

 	Same as above, but replace the account for all selected files, 
 	regardless of the existing account number. Note that this may
 	be done more efficiently with DISKCHARGE/SET.

2 /SCAN
 Invokes DISKCHARGE to scan an entire disk and write the system
 summary file to be incorporated into the VAX Resource Accounting
 system. Requires BYPASS/READALL, SYSPRV, and OPER privileges.
 
 Note:  This is normally run only by the System Manager or automatically
 	for accounting purposes. It will update or create the file
 	SYS$COMMON:[SYSMGR]DISKCHARGE_ACC.DAT.
 	
        If the disk which is the target of the SCAN operation is served
        to a Local Area or Mixed Interconnect VAXcluster, DISKCHARGE
        should only be run on the machine to which the disk is directly
        connected.
       
  Format:
        DISKCHARGE/SCAN disk-name
 
3 Parameters
        disk-name
 
        Specifies the name of the disk to be scanned.
        No wild card characters are allowed.
 
3 Command_Qualifiers

/ERROR

 /ERROR[=file-spec]
 Any failed attempt to assign an account to a file will be logged to
 this file. This could be caused by no file owner in SYSUAF, the
 account field in SYSUAF being invalid, or by the owner no longer being
 allowed to charge the account. It could also be caused by a file being
 owned by an IDENTIFIER which has no corresponding USERNAME entry in
 SYSUAF. 

 If /ERROR is not specified, all errors will be sent to the file
 specified in /OUTPUT (SYS$OUTPUT by default).
 
/LOG
 
 /LOG
 Log results of each file access to the terminal or output file.
 
/OUTPUT
 
 /OUTPUT[=file-spec]
 
 Specifies the output file.  If you omit  the /OUTPUT qualifier,
 output is directed to SYS$OUTPUT.

/REPAIR

 /REPAIR
 Specifies that any file which does not have an account number
 attached to it, or which has an invalid account, is to be tagged with
 the owner's default (SYSUAF) account. For files owned by an
 identifier ACE, the owner will be looked up in ACCAAF.DAT and the
 first matching record will be used. 
 
 This qualifier requires the user to have BYPASS privilege.
 
3 Examples

 	$ DISKCHARGE/SCAN/REPAIR/ERROR=DUA0_DISKCH_ERR.LOG VAXH$DUA0:

 	Will scan the entire (volume set) VAXH$DUA0, assigning default
 	account numbers to any files which are not tagged. Any file
 	which cannot be tagged, will be noted in DUA0_DISKCH_ERR.LOG.

2 /SET
  Invokes DISKCHARGE to place an account or charge number on a file.
  The /SET qualifier is required. The user must have the privilege to
  read and write the file (RW), and must be authorized to charge the
  specified account (or have OPER privilege).
 
  Format:
 
        DISKCHARGE/SET/ACCOUNT=account_number [file-spec]
 
3 Parameters
    file-spec
 
    Specifies the name of the file or directory tree which is to
    be processed.
 
    Wild card characters are allowed in the file specification which
    defaults to *.*;*
 
3 Command_Qualifiers
 
/ACCOUNT
 
 /ACCOUNT=account_number
 
 Specifies the new charge number which is to be assigned to the file.
 The charge number must be valid, and the user must be authorized to
 charge it, or currently be running with OPER privilege. 

 /ACCOUNT and /PROJECT are synonyms.
  
/DEFAULT

 Specifies that the charge number in the user's authorization record in
 SYSUAF be charged. This can be displayed and modified by typing
 			RUN ACC$:SET_DEF_ACCOUNT.
 
/LOG
 
 /LOG
 Log results to the current output terminal/file.
 
/OUTPUT
 
 /OUTPUT[=file-spec]
 
 Specifies the output file.  If you omit  the /OUTPUT qualifier,
 output is directed to SYS$OUTPUT.
 
/PROJECT
 
 /PROJECT=account_number
 
 Specifies the new charge number which is to be assigned to the file.
 The charge number must be valid, and the user must be authorized to
 charge it, or currently be running with OPER privilege. 

 /ACCOUNT and /PROJECT are synonyms.
 
3 Examples

   $ DISKCHARGE/SET/ACCOUNT=AB4567 [XYZ]*.TXT;*
         For all files ending in .TXT in directory [XYZ], set the
         account number to AB4567.
  
2 /SHOW
 Invokes DISKCHARGE to display information about files. This
 information includes the name of the file, the account or charge
 number (if any) and (optionally) the size of the file.
 
  Format:
 
        DISKCHARGE/SHOW file-spec
 
3 Parameters
    file-spec
 
    Specifies the name of the file or directory tree which is to
    be processed.
 
    Wild card characters are allowed in the file specification which
    defaults to *.*;*
 
3 Command_Qualifiers
 
/ACCOUNT
 
 /ACCOUNT[=account_number]
 
 Specifies that only files with this charge number are to be
 displayed. The charge number must be valid, and the user must be
 authorized to charge it, or currently be running with OPER privilege.
 If no account number is specified, or if it is specified as "*", all
 files will be displayed. 

 /ACCOUNT and /PROJECT are synonyms.
 
 /EXCEPT
 
 /EXCEPT=account_number
 
 Specifies that only files which DO NOT have this charge number are 
 to be displayed. 

/GRAND_TOTAL

 /GRAND_TOTAL
 Do not display individual file sizes, only totals. 

/OUTPUT
 
 /OUTPUT[=file-spec]
 
 Specifies the output location to display results.  If you omit  the 
 /OUTPUT qualifier, output is directed to SYS$OUTPUT.
 
/PROJECT
 
 /PROJECT=account_number
 
 Specifies that only files with this charge number are to be
 displayed. The charge number must be valid, and the user must be
 authorized to charge it, or currently be running with OPER privilege.
 If no account number is specified, or if it is specified as "*", all
 files will be displayed. 

 /ACCOUNT and /PROJECT are synonyms.
 
 /SIZE

 /SIZE (default)
 Show the size of each selected file in blocks.


3 Examples

    $ DISKCHARGE/SHOW/ACCOUNT=AB0001

 	 Diskcharge VAXH$DUA0:[VSG]

         ADAMAKE.COM;1                      0   AB0001  
         ATS_MYEVE.TPU$SECTION;11         868   AB0001  
         ATS_TPU$COMMAND.TPU;4              2   AB0001  
         AUTOUSER.BAT;2                     4   AB0001  
 		...

 	 Z.Z;1                              2   AB0001  
 	 Total of 1 directory, 87 files, 5478 blocks


 	Show each file in the current directory which has 
 	the account number AB4567. This will display the filename, 
 	account number, and number of blocks.

     $ DISKCHARGE/SHOW/EXCEPT=AB4567 
         Show each file in the current directory which DOES NOT 
 	 have the account number AB4567. 

     $ DISKCHARGE/SHOW/GRAND_TOTAL/ACCOUNT=AB0001
 	Total of 1 directory, 87 files, 5478 blocks
 
2 /SUMMARY
 Invokes DISKCHARGE to display a summary of usage.
 This information is derived from a file which is created or updated
 as a result of the Sytem Manager running a DISKCHARGE/SCAN pass and
 will reflect data as of the last SCAN operation. 

 It shows the amount of space in terms of disk-block-days, which
 represents the average number of blocks occupied multiplied by the
 number of days they were in use.
  
  Format:
 
        DISKCHARGE/SUMMARY disk-name
 
 
3 Parameters
 
3 Command_Qualifiers

/ACCOUNT=account_number

 Display usage for account number specified. The user must be
 authorized to charge this account if it is valid. If not specified,
 usage for the account which is currently being cahrged will be
 displayed.

 If /ACCOUNT=* is specified, the program will list the usage by the
 specified user for all accounts he/she is able to charge. If the user
 has OPER privilege, all accounts may be viewed. 

 /ACCOUNT and /PROJECT are synonyms.

/BEFORE
 
 /BEFORE[=date-time]
 
 Specifies that only those entries dated earlier than the stated
 date-time be selected for the error report. You can specify an
 absolute time, a delta time, or a combination of absolute and delta
 times.

 By default, all entries will be displayed.
 
/OUTPUT
 
 /OUTPUT[=file-spec]
 
 Specifies the output file.  If you omit  the /OUTPUT qualifier,
 output is directed to SYS$OUTPUT.

/PROJECT=account_name

 Display usage for account number specified. The user must be
 authorized to charge this account if it is valid. If not specified,
 usage for the account which is currently being cahrged will be
 displayed.

 /PROJECT=*

 If /PROJECT=* is specified, the program will list the usage by the
 specified user for all accounts he/she is able to charge. If the user
 has OPER privilege, all accounts may be viewed. 

 /ACCOUNT and /PROJECT are synonyms.

/SINCE
 
 /SINCE[=date-time]
 
 Specifies that only those entries dated later than the stated
 date-time be selected for the error report. You can specify an
 absolute time, a delta time, or a combination of absolute and delta
 times.

 By default, all entries will be displayed.

/USER

 /USER=username

 If not specified, usage for the current useranme will 
 be displayed.

 To display usage for another username, privilege is required:
 	WORLD privilege allows display of anybody's usage;
 	GROUP privilege allows display of the usage for anybody 
 			in the same UIC group.

 /USER=*

 Display summary of usage for all users charging specified account.
 Requires WORLD privilege. 

3 Examples

 $ DISKCHARGE/SUMMARY
 Summary of disk space usage for VSG on AB0001 From  8-JUN-1989 To 19-JUN-1989

    DISK$SABLE_SYS                         13314
    CAS$DISK                               60650
    USER$DISK                             631852
    DISK$VAXH_SYS                         356883
    DISK$JEKYLL_SYS                           31
    DISK$HONDA_SYS                          1047
    DISK$NINE28_SYS                        36489
    DISK$SUPRA_SYS                         26184
    DISK$SR5_SYS                            1065
                                        --------
                        Grand Total =    1127515


 $ DISKCHARGE/SUM/USER=QUINBY/ACCOUNT=*
 Summary of disk space usage for QUINBY From  8-JUN-1989 To 19-JUN-1989

  Account:  AB0001  
    USER$DISK                               3216
                                        --------
                              Total =       3216

  Account:  AB4700  
    USER$DISK                               4610
                                        --------
                              Total =       4610

                        Grand Total =       7826


2 Support
 DISKCHARGE is supported on a time-available basis by Al Sorrell of
 the Westinghouse VAX Support Group at Baltimore.
 Please forward specific problems, suggestions, etc. to VAXH::VSG or to:
         Al Sorrell  
         Westinghouse VAX Support Group
         P.O. Box 746   MS 1615
         Baltimore, Md  21203

2 Default Account
 Each user has a default account entry in his/her authorization
 record in the System User Authorization File (SYSUAF). This is
 usually the account which was specified when the user was first
 authorized to log on a system. 

 This account is used to tag files during the initial setup of the
 DISKCHARGE system and subsequently when the System Manager scans the
 disk(s) to record usage, so it's important that this number be valid.
 To this end, the account field is checked for validity at login and
 the user will be forced to specify a valid charge if it is bad.
                                                
 The user may also display and/or change its value at any time by
 typing:
 	$ RUN ACC$:SET_DEF_ACCOUNT

2 Setup Tips
 To get ready for the use of DISKCHARGE, the System Manager should clean
 up their accounting files and SYSUAF as outlined below. This will help
 minimize problems when trying to set initial or default charge numbers
 on files:

 1) Check that all users have a currently valid account number in their
 UAF entry. 

 2) Any identifiers which own files should have an entry made in ACCAAF
 indicating that the identifier may charge an account provided by the
 owner. Don't know who's responsible for an identifier? You can get a
 list of the holders of an identifier by running AUTHORIZE and typing
 	SHOW/IDENTIFIER/FULL identifier

 3) Make sure you're running ACC$:CHECK_DEF_ACCOUNT as part of the
 interactive login accounting check. This checks that the account in
 SYSUAF is always valid at the time of login or prompts user for valid
 charge.

 $ INTERACTIVE_ACCOUNTING:
 $   ASSIGN/USER SYS$COMMAND SYS$INPUT
 $   RUN ACC$:ACCLOGIN
 $   IF .NOT. $STATUS THEN LOGOUT/BRIEF
 $   ASSIGN/USER SYS$COMMAND SYS$INPUT
 $   RUN ACC$:CHECK_DEF_ACCOUNT
 $   IF .NOT. $STATUS THEN LOGOUT/BRIEF
 $   GOTO CHECK_TERM

 4) See if there are users who own files but no longer have an entry in
 SYSUAF. These will show up if you look at DISKQUOTA records for your
 disks. They will also be flagged as errors during the SCAN pass. If
 such exist, you should put up a system notice for a reasonable period
 of time advertising for the owner, and then archive (BACKUP/DELETE) the
 files. This may even help get back some disk space!

 5) Find users who haven't logged in recently - 6 months to a year. You
 can use  RUN MGRUTIL$:DISKSPACE to generate such a report. This will
 also generate the DISKQUOTA info from 4 above. If they have files,
 archive them or otherwise put them up for disposition.

 6) Once DISKCHARGE is installed on your system, advertise the fact that
 DEFAULT accounts will be generated for all files on such-and-such a
 date (two weeks in the future or so). This gives users time (&
 hopefully incentive) to tag files if they so choose. Then run the
 SCAN/REPAIR pass after the period has elapsed.
 
 7) If you have a CI-based cluster with multiple machines, you should 
 define a generic batch queue BATCH$DISKCHARGE which can feed multiple
 execution queues to spread the load around. Any machine connected via
 a CI/HSC should help out in the scanning process. Machines connected
 via Ethernet in a LAVC should not, since the time to serve the disk
 requests and the amount of traffic would be overwhelming.
