CRAA055@VAXB.CC.KCL.AC.UK (08/12/87)
Juergen Renz requests a way for his unprivileged users to recover their
[SYSLOST] files. We approach the problem as follows:-
1. At 4AM every day, we run a housekeeping job via an automatic scheduler
(which is written in DCL and can be posted to anyone interested -
it works like the unix CRON facility)
2. The job which runs does an ANALYSE/DISK/REPAIR on the disk in question
3. Following the ANALYSE, which places "lost" files in the [SYSLOST]
directory, is the bit of DCL given below.. You can hack it to suit your
own local conventions. Most basic assumption is that users directory
name is the same as his sign-on username!
Any comments on this approach are welcomed.
Regards,
Andy Harper,
Kings College London UK
+---------------------------------------------------------------------------+
I Computing Centre, Kings College, Strand, London, UK I
I Tel: +44 (0)1 836 5454 I
+-------------------------------------------+-------------------------------+
I JANET: A.Harper @ UK.AC.KCL.CC.VAXB I ARPA: A.Harper%KCL.CC.VAXB I
I I @ ucl-cs.arpa I
I EARN: A.Harper @ VAXB.CC.KCL.AC.UK I ARPA: A.Harper I
I or A.Harper%VAXB.CC.KCL.AC.UK @ AC.UK I @ VAXB.CC.KCL.AC.UK I
I I I
I UUCP: ...ukc!uk.ac.kcl.cc.vaxb!A.Harper I ARPA: A.Harper%KCL.CC.VAXB I
I I @ CS.UCL.AC.UK I
I EAN: A.Harper @ VAXB.CC.KCL.AC.UK I I
+-------------------------------------------+-------------------------------+
$! ------------- Following extract is a [SYSLOST] cleanup routine -----
$
$! -- Try to recover any files that were put into [SYSLOST] by the analysis
$! above. Do this for user disk only. Others should be done manually.
$!
$ write sys$output "Start Recovery of [SYSLOST] ", f$time()
$ P1 = "DISKB:[SYSLOST]" ! Directory to search
$ find_file:
$ file = f$search("''P1'*.*;*") ! Locate files
$ if file .eqs. "" then $ goto end_file_recovery
$ device = f$parse(P1,,,"DEVICE") ! Get which disk
$ idname = f$parse(file,,,"NAME") - ! Construct new name
+ f$parse(file,,,"TYPE") -
+ f$parse(file,,,"VERSION")
$ owner= f$file(file,"UIC") ! Get file UIC
$ owner= f$extract(1,f$length(owner)-2,owner) ! remove [ ] !
$ comma= f$locate(",",owner) ! find any comma
$ if comma .ne. f$length(owner) then - ! if theres a group..
owner= f$extract(comma+1,f$length(owner),owner) ! .. remove it.
$ rename/log 'file 'device['owner] ! rename file
$ mail/self/subject="Lost file ''idname' " sys$input 'owner
The above named file was found to be "lost" in the system and has been
recovered and renamed into your top-level directory.
$ goto find_file
$
$end_file_recovery:
$ write sys$output "End Recovery of [SYSLOST] ", f$time()
$
$! ------------- END OF SYSLOST CLEANUP ROUTINE --------------