.! DSKCHG.RNO .! RUNOFF/OUT=.DOC/MESSAGES=USER DSKCHG .! .lm 0 .rm 60 .sp 1 .ts 5 .r;May 18, 1983 .sk 2 DSKCHG is a program which takes a list of current users (from AUTHORIZE) and a disk block usage list (from DISKQUOTA) and sends records to the accounting manager for billing purposes. A command file, QTAACCNT.COM, controls the production of the user and disk usage lists and performs some preprocessing (sorting) before the DSKCHG program is run. Also see QUOTA.DOC for information about processing the accounting file. .sk 2 ^&FILES\& .sk 1 There are ten files that are created or modified for each execution of the QTAACCNT command file. The following is a list of the files and their dispostion. .sk 1 In the directory QTAACCNT$FILES: .sk 1 DISKQ.TMP#-#created by DISKQUOTA, this file contains the usage and allocation for every UIC on the QTAACCNT$QCHECK: disk. Old versions are deleted at the beginning of the command file. .sk 1 DISKQ.SRT#-#DISKQ.TMP sorted by UIC. Old versions are deleted at the beginning of the command file. .sk 1 SYSUAF.TMP#-#A temporary copy of the output from AUTHORIZE, it contains the accounts and UIC's. Old versions are deleted at the beginning of the command file. .sk 1 SYSUAF.SRT#-#SYSUAF.TMP sorted by UIC. Old versions are deleted at the beginning of the command file. .sk 1 DSKCHG.TIM#-#Contains the time that the DSKCHG program was last run. This file is updated by the program and old versions are purged. .sk 1 DSKCHG.LIS#-#Listing of all accounts, UIC'S, disk usage and allocations that were sent to the accounting manager. The period for the billing and the number of days (times) each account was billed is also listed. .sk 1 DSKCHG.ERR#-#If an error occurs during the execution of DSKCHG then this file will contain a message and diagnostic information. If no errors occur this file will be deleted at program exit. Old versions are not affected. .sk 1
.SRT#-#This file is named after the month and date of the command file execution and is a copy of DISKQ.SRT. It will be necessary to manually delete old copies of this file. .sk 1 In the directory QTAACCNT$BATCH the following file is created- .sk 1 QTAACCNT.LOG#-#This is the batch log file which will be printed out if an error is detected. Old versions are purged by the command file. .sk 1 In the directory SYS$SYSTEM the following file is created- .sk 1 SYSUAF.LIS#-#This is the listing file created by AUTHORIZE, old versions will be purged. .sk 2 ^&PRIVILEGES\& .SK 1 Two privileges are necessary to operate the disk billing command file and the DSKCHG program. In order to create the input files you must possess the BYPASS privilege. For a mailbox to be used in the system send to accounting service (SYS$SNDACC) the process must have the TMPMBX (temporary mailbox) privilege. No privileges are required to make a USER entry in the accounting log file. .sk 2 ^&LOGICAL ASSIGNMENTS\& .sk 1 The following process logical assignments are made by the command file: .sk 1 QTAACCNT$QCHECK is assigned to the device that billing is performed on. .sk 1 QTAACCNT$BATCH is assigned to the default login directory from which the QTAACCNT command file will be submitted to the Batch queue. This is where the batch log files will be purged from. .sk 1 QTAACCNT$FILES is assigned to the directory where the DSKCHG image is located and where all the output files will be placed. (This should probably be a sub-directory of QTAACCNT$BATCH.) .sk 1 The following file assignments are made prior to the execution of the DSKCHG image. By changing these USER_MODE assignments different files and additional disks can be processed for each execution of the QTAACCNT command file. See the FILES section for a description of each file. .sk 1 QFIL: to QTAACCNT$FILES:DISKQ.SRT .sk 1 UAFFIL: to QTAACCNT$FILES:SYSUAF.SRT .sk 1 ERRFIL: to QTAACCNT$FILES:DSKCHG.ERR .sk 1 MSGFIL: to QTAACCNT$FILES:DSKCHG.LIS .sk 1 TIMFIL: to QTAACCNT$FILES:DSKCHG.TIM .sk 2 ^&IMPLEMENTATION\& .sk 1 The following steps are changes for site dependencies- .sk 1 .i9;^&Modifications to QTAACCNT.COM\& .ls .le;Replace the device DISK$AGLUSER in the following line so that QTAACCNT$QCHECK is assigned to the disk that you want billing to be performed on- .sk1 $ ASSIGN DISK$AGLUSER: QTAACCNT$QCHECK: .le;Replace the device and directory in the following line so that QTAACCNT$BATCH is assigned to the default login directory for the account that will be used to submit the QTAACCNT.COM file- .sk1 $#ASSIGN#SYS$SYSDEVICE:[OPERATOR]#QTAACCNT$BATCH: .le;Replace the device and directory in the following line so that QTAACCNT$FILES is assigned to the location where all the files will be manipulated- .sk 1 $#ASSIGN#SYS$SYSDEVICE:[OPERATOR.QTA]#QTAACCNT$FILES: .le;Change the following names so that mail messages are sent to the appropriate people if an error occurs- .sk 1 .i5;CCTLINSCOMB,OPERATOR .le;IMPORTANT: The line that begins "SET#FILE#QTAACCNT$QCHECK:" makes sure that all files are owned by their parent directory and that charges will be correctly apportioned. This command takes a significant amount of time to execute and the command file can be speeded up if it is removed. The trade off is that an account may be billed for files that do not reside in it's directory. .le;Move the file QTAACCNT.COM into the directory QTAACCNT$BATCH:. .els .i9;^&Modifications to DSKCHG.FOR\& .ls .le;System UICs that have disk space but no entry in the User Authorization File will be provided with a special account. These UICs (with group numbers from 1 to 10) receive the account "CCVV001" and a username of "OVERHEAD". To change the account and name, alter the DATA lines in the file DSKCHG.FOR for the variables "ovrhd" and "ovrnam". Execute the command file DSKCHGBLD if this change is made. .le;Move the file DSKCHG.EXE into the directory QTAACCNT$FILES:. .els .i9;^&Executing Program WRTTIM\& .ls .le;Execute the program WRTTIM. The time input should be 24 hours prior to the first time QTAACCNT.COM is to be executed. This will provide for a single days billing. Move the created file, DSKCHG.TIM, to the directory QTAACCNT$FILES:. .els .br;^&TO PERFORM DAILY BILLING\& .sk 1 The command file QTAACCNT.COM should be submitted into a batch queue once every 24 hours. By using the qualifiers on the submit command the job can be made to run at a specific time along with ensuring that it will be the next job queued after that time. Example submit command: .sk 1 .ts 20 .i5;$ submit /after="tomorrow+3:00" - .i20;/queue=sys$batch - .i20;/priority=5 - .i20;/log_file=qtaaccnt$batch:qtaaccnt.log - .i20;qtaaccnt$files:qtaaccnt.com .ts 5 .sk 1 If everything goes correctly then a USER record will be entered into the accounting file for each quota entry on the disk. See QUOTA.DOC for information on removing these records from the accounting file and processing them into a usage list. .sk 2 ^&THE DSKCHG USER ACCOUNTING RECORD\& .sk 1 Accounting record formats are described in the VAX/VMS "Utilities Reference Manual", appendix C. In addition to the information from the accounting system the following is contained in each record- .ls .le;SYSTEM TIME when DSKCHG was run .le;ACCOUNT NUMBER to be billed .le;USER NAME for account .le;A subcode to differentiate DSKCHG user records from other user records. .le;UIC for account .le;Number of disk blocks used. .le;Number of disk blocks allocate to the UIC. (If the UIC is over allocation then this number will be total disk usage.) .le;Disk on which billing was performed. (Obtained by a single process level logical translation of QTAACCNT$QCHECK.) .els An important note is that all the records are entered under the single account from which DSKCHG is run and not under the individual accounts to be billed. .sk 2 ^&COMMENTS AND SUGGESTIONS\& .sk 1 In submitting this program I have avoided making any last minute "tweaks" that would only lead to problems. The program DSKCHG and command file QTAACCNT have been used at UT on an RP07 for about 1 year with very little trouble. Good luck, and for any comments please contact me. .sk 1 .lm 10 .br;Thomas J. Linscomb .br;Computation Center .br;The University of Texas at Austin .br;Austin, TX 78712 .sk 1;PHONE:##(512) 471-3241