home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.madoka.org
/
2014.12.ftp.madoka.org.tar
/
ftp.madoka.org
/
pub
/
plum
/
2.x
/
plum2_32_1.lzh
/
module
/
sys
/
timer.plm
< prev
next >
Wrap
Text File
|
1999-02-20
|
3KB
|
94 lines
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><!-- $_ if 0; # -*- perl -*-
# $Id: timer.plm,v 2.10 1999/01/15 15:38:37 hasegawa Exp $
# copyright (c)1998-1999 Yoshinori Hasegawa <hasegawa@madoka.org>
package sys_timer;
$FORMAT = '%Y/%m/%d %H:%M:%S';
$_ = 'sys_timer';
sub main_loop {
local($userno) = @_;
local($now, $regex, $str, $date, $time, $exec, @addlist);
$now = &'date($FORMAT);
foreach $last (&'array($timerlist[$userno])) {
$regex = &'regex($last);
next if $now =~ /$regex/;
$timerlist[$userno] = &'remove($timerlist[$userno], $last);
}
foreach $timer (&'property($userno, 'exec')) {
($date, $time, $exec) = split(/\s+/, $timer, 3);
$str = $date . ' ' . $time;
$regex = &'regex($str);
next unless $now =~ /$regex/;
push(@addlist, $str);
next if &'exist($timerlist[$userno], $str);
system(&'date($exec));
}
$timerlist[$userno] = &'add($timerlist[$userno], @addlist);
}
__END__
--><HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-2022-JP">
<LINK REV="made" HREF="mailto:hasegawa@madoka.org">
<TITLE>sys/timer.plm</TITLE></HEAD><BODY>
$B%*%s%i%$%s%I%-%e%a%s%H(B
<HR><H3>$BL>A0(B</H3>
sys/timer.plm - $B;XDj$5$l$?;~4V$K;XDj$5$l$?%3%^%s%I$r<B9T$9$k(B
<HR><H3>$B@bL@(B</H3>
$B;XDj$5$l$?;~4V$K$J$k$H;XDj$5$l$?%3%^%s%I$r<B9T$7$^$9!#(B
<HR><H3>$B%W%m%Q%F%#(B</H3>
<DL>
<DT> sys.timer.exec* $BF|IU(B $B;~4V(B $B%3%^%s%I(B
</DT>
<DD> $B%3%^%s%I$r<B9T$9$kF|IU!";~4V$H<B:]$N%3%^%s%I$r;XDj$7$^$9!#(B
$BF|IU!";~4V!"%3%^%s%I$O$=$l$>$l6uGr$G6h@Z$j$^$9!#(B
$BF|IU$O(B1970/01/01$B!";~4V$O(B00:00:00$B$N%U%)!<%^%C%H$G!"(B
$B$=$l$>$l%o%$%k%I%+!<%I$H$7$F(B*$B$H(B?$B$,;XDj$G$-$^$9!#(B
$B%3%^%s%I$K$O(Bperl$B$NJ8$G$O$J$/!"(B
$B<B9T%U%!%$%k$d%9%/%j%W%H$r;XDj$7$F2<$5$$!#(B
$B$^$?!";~4V$N;XDj$O$"$kDxEY$NI}$r;}$C$F;XDj$9$k$h$&$K$7$F2<$5$$!#(B
00:00:00$B$N$h$&$K87L)$K;XDj$9$k$H!"<B9T$5$l$k$3$H$O$^$:$"$j$^$;$s!#(B
</DD>
</DL>
<HR><H3>$B@_DjNc(B</H3>
<PRE>
+ sys/timer.plm
sys.timer.exec: */01/01 *:*:* echo 'A happy new year' | mail hasegawa
</PRE>
$BKhG/(B1$B7n(B1$BF|$K$J$k$H!"!V(Becho 'A happy new year' | mail hasegawa$B!W(B
$B$H$$$&%3%^%s%I$r<B9T$7$^$9!#(B
$B$3$l$O!V(BA Happy new year$B!W$H$@$1=q$+$l$?%a!<%k$r(Bhasegawa$B08$KAw$j$^$9!#(B
<PRE>
+ sys/timer.plm
sys.timer.exec: */*/* 00:*:* logmail
</PRE>
$BKhF|(B0$B;~$K$J$k$H!"!V(Blogmail$B!W$H$$$&%3%^%s%I$r<B9T$7$^$9!#(B
<PRE>
+ sys/timer.plm
sys.timer.exec: */*/* *:*:* echo start plum
</PRE>
$B5/F0;~$K0l2s$@$1!V(Becho start plum$B!W$H$$$&%3%^%s%I$r<B9T$7$^$9!#(B
</BODY></HTML>