- 833 名前:login:Penguin mailto:sage [2019/01/30(水) 20:28:48.27 ID:AO3waAfD.net]
- 他人にWeb鯖貸すときの監視はこれでいいですか?
#!/usr/bin/perl use strict; use warnings; my $num = 0; while( $num <= 9 ){ foreach(`ps -Af`){ $_ =~ s/ +/ /g; my($user, $pid, undef, undef, undef, undef, $time) = split(/ /, $_); $user =~ /[\.\+]/ or next; my(undef, $min, $sec) = split(/:/, $time); $min =~ s/0(\d)/$1/; $sec =~ s/0(\d)/$1/; ($min > 0 || $sec > 20) and `kill -9 $pid`; } sleep 180; }
|

|