On Nov 7, 4:58pm, Jeff Kell wrote:
> Subject: Re: Aborting users at backup time
> A posix/perl nerd would suggest:
>
> shell/iX> cat abortjobs
> #!/usr/local/bin/perl
> unless (open(PIPE,"callci showjob exec|")) {
> die "unable to open showjob pipe";
> }
> while ($line=<PIPE>) {
> if ($line=~/(#[J,S]\d+)\b.*/) {
> $victim = $1;
> if ($line!~/.*[OPERATOR,MANAGER]\.SYS.*/) {
> print "abortjob $victim \n";
> }
> }
> }
>
> This script will abort everything except OPERATOR and MANAGER.SYS if...
An equally nerdy CI script (also requiring 5.5) is:
PARM except="MANAGER.SYS OPERATOR.SYS", entry=main
if "!entry" = "main" then
showjob >sjout
xeq !hpfile !except, entry=abortjob <sjout
return
elseif '!entry' = 'abortjob' then
setvar i 0
while setvar(i,i+1) <= finfo(hpstdin,'eof') do
if lft(setvar(buf,input()),1) = '#' and &
pos(setvar(job,word(buf,,-1)),"!except") = 0 then
continue
abortjob !job
endif
endwhile
return
endif
PLEASE NOTE: this has **not** been tested, but you get the idea...
Jeff Vance, CSY
--
|