1
0
mirror of https://github.com/PDP-10/its.git synced 2026-02-10 10:19:50 +00:00

GCMAIL - delete old files from .MAIL.

This commit is contained in:
Lars Brinkhoff
2018-04-23 18:16:49 +02:00
committed by Eric Swenson
parent 3cc1c13c38
commit 9393d717d6
3 changed files with 132 additions and 0 deletions

127
src/sra/gcmail.17 Executable file
View File

@@ -0,0 +1,127 @@
;-*-midas-*-
title gcmail -- gc the .mail.; directory (or clone thereof)
;; We flush DSK:.MAIL.;OSTATS * files that are older than AGE
;; seconds, provided the file is backed up and isn't set no-reap.
days==24.*60.*60.
age: 7*days
irp z,,[a,b,c,d,e,q]
z==.irpcnt+1
termin
p==17 ? call=:<pushj p,> ? ret=:<popj p,>
.insrt ai:system;t20mac >
$$abs==1
.insrt ai:syseng;datime >
.begin fsdefs
.insrt ai:system;fsdefs >
.end fsdefs
define syscal foo,bar
.call [setz ? sixbit 'foo' ? bar ((setz))]
termin
.scalar ufd(ufdlen==2000), pdl(pdllen==200), curtad, dir
dev: sixbit |DSK |
dirtab: sixbit |GCMAIL| ? sixbit |.MAIL.|
sixbit |GCBULK| ? sixbit |.BULK.|
0 ? sixbit |.MAIL.|
lstfn1: sixbit |.FILE.|
lstfn2: sixbit |(DIR) |
gcmail: move p,[-pdllen,,pdl-1]
.suset [.rxjname,,1]
setz 2,
do.
skipe dirtab(2)
camn 1,dirtab(2)
exit.
addi 2,2
loop.
enddo.
move 1,dirtab+1(2)
movem 1,dir
.suset [.roption,,0]
syscal open,[movsi .bii ? movei ? dev ? lstfn1 ? lstfn2 ? dir]
.lose
move 1,[-ufdlen,,ufd]
.iot 1
skipge 1
.lose
.close 1,
move 1,ufd+fsdefs"udname
came 1,dir
.lose
call datime"timgtn
.lose
movem a,curtad
; tlne %opddt
; .value [asciz " p"]
move q,ufd+fsdefs"udnamp
addi q,ufd
do.
move 1,fsdefs"unfn1(q)
came 1,[sixbit 'OSTATS']
ifskp.
move 1,fsdefs"unrndm(q)
tlnn 1,fsdefs"unreap
tlnn 1,fsdefs"undump
anskp.
movei 1,fsdefs"unfn2(q)
call isanum
anskp.
move a,fsdefs"undate(q)
call isold
anskp.
tlne %opddt
ifskp.
syscal delete,[dev ? fsdefs"unfn1(q) ? fsdefs"unfn2(q) ? dir]
.lose
else.
.value [asciz ": Delete îq/ '
'î"]
endif.
endif.
addi q,fsdefs"lunblk
caige q,ufd+ufdlen
loop.
enddo.
.logout 1,
jrst .-1
isanum: hrli 1,440600
movei 2,6
do.
ildb 3,1
jumpe 3,.+4
cail 3,'0
caile 3,'9
ret
sojg 2,top.
enddo.
aos (p)
ret
isold: call datime"timnet
add a,age
camge a,curtad
aos (p)
ret
...var::variab ; sic
...lit: consta