1
0
mirror of https://github.com/PDP-10/its.git synced 2026-01-15 16:07:01 +00:00

Added TMPKIL and hourly DRAGON job to clean out .TEMP.;

This commit is contained in:
Eric Swenson 2016-12-10 19:03:34 -08:00
parent e793205336
commit 0d76193453
3 changed files with 106 additions and 0 deletions

View File

@ -188,6 +188,7 @@ There's a [DDT cheat sheet](doc/DDT.md) for Unix users.
- TELNET, Telnet client.
- TELSER, Telnet/Supdup server.
- TIMOON, displays the time and phase of the moon.
- TMPKIL, clean out old files in .TEMP.;.
- TTLOC, Advertises physical location of logged in users.
6. A brand new host table is built from the host table source and

View File

@ -863,6 +863,11 @@ expect ":KILL"
respond "*" ":midas sys2;ts stylog_sysen1;stylog\r"
expect ":KILL"
# TMPKIL
respond "*" ":midas sys2;ts tmpkil_syseng;tmpkil\r"
expect ":KILL"
respond "*" ":link dragon;hourly tmpkil,sys2;ts tmpkil\r"
# ndskdmp tape
respond "*" ":link kshack;good ram,.;ram ram\r"
respond "*" ":link kshack;ddt bin,.;@ ddt\r"

100
src/syseng/tmpkil.12 Normal file
View File

@ -0,0 +1,100 @@
title TMPKIL -- Kill files on .TEMP. directory
a=1
b=2
c=3
d=4
e=5
t=6
tt=7
sp=17
p==sp ;to make DATIME > happy
dski=10
.insrt SYSENG;FSDEFS >
.insrt RWK;SYSCAL >
datime"$$ABS==1 ;include routines for absoulute time
.insrt SYSENG;DATIME >
pdl: -20,,.
block 20
dir: block 2000
dirend:
go: .close 1, ;runs as demon on system startup
move sp,pdl ;initialize the PDL
skipn expire ;is this simply an old-file reap?
jrst dirget ; yes, don't bother with the time
call datime"timget ;get the time
camn a,[-1] ;is the time unknown?
.logout 1, ; yes, don't do anything!
movn b,expire ;get expiration period
call datime"timadd ;that time ago
dirget: syscal open,[cnti .uii ;read in the directory in image mode
argi dski
[sixbit /DSK/]
[sixbit /.FILE./]
[sixbit /(DIR)/]
[sixbit /.TEMP./]]
.lose %lsfil
move t,[444400,,dir] ;read in the directory
movei tt,2000 ;(all 1k of it)
syscal siot,[argi dski ? t ? tt]
.lose %lsfil
.close dski,
move d,udnamp+dir ;get relative loc of name section
addi d,dir ;make it absolute
chkfil: cail d,dirend ;is it the end?
jrst [skipn debug ;debugging?
.logout 1, ;all done, log out
.value ;must be debuging!
jrst .]
move tt,unrndm(d) ;get flag word
tlnn tt,unreap ;is it not to be reaped?
tlne tt,unigfl ; or otherwise ignored?
jrst nxtfil ; yes, skip it
;reap
skipe expire ; are we expiring old ones only?
camle a,undate(d) ; yes, is it new?
caia ; no, gobble it down
jrst nxtfil ; yes, skip it!
;; Here we have found a file which does not have it's don't-reap bit
;; on and is not to be ignored. Therefore we should delete it
syscal delete,[[sixbit /DSK/]
unfn1(d) ;FN1 from directory
unfn2(d) ;FN2 from directory
[sixbit /.TEMP./]]
jrst [skipn debug ;huh? must of gone away by itself?
jrst nxtfil ; so ignore it
.value ;debuging, so let's notice the fact
jrst nxtfil] ;but continue
nxtfil: addi d,lunblk
jrst chkfil
vrsadr: .fnam1
.fnam2
debug: 0
expire: 0 ;if nonzero, this is EXPIRE so only delete
;files older than this many seconds ago.
second==1
minute==60.*second
hour=60.*minute
day=24.*hour
week=7.*day
month=30.*day
end go