kill ve skriptu nefunguje
Jan Pechanec
jp at devnull.cz
Mon Oct 27 12:28:43 CET 2008
On Mon, 27 Oct 2008, Jan Pechanec wrote:
>>#!/bin/sh
>>kill -9 `ps ax | grep -v grep | grep 'test.pl [A-Z]' | awk '{print $1}'`
>>
>>for var in A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
>>do
>> nice -n 10 /home/milanc/scripts/dohled/test.pl $var &
>>done
>
> ps(1):
>
> -a Display information about other users' processes as well as your
> own. This will skip any processes which do not have a control-
> ling teminal, unless the -x option is also specified. This can
> be disabled by setting the security.bsd.see_other_uids sysctl to
> zero.
>
> tohle dela tvuj problem:
>
> "will skip any processes which do not have a controlling terminal"
hmm, nevsimnul jsem si ze tam -x mas, sorry.
s cestou v /etc/crontab jsi asi nehybal, jediny rozdil co vidim je
ze na prikazovy radce je kill asi vestaveny prikaz, v tom skriptu ne, ale
nevim proc by to melo delat problem.
obecne - vzdycky si muzes dat par debug hlasek do toho skriptu, tj.
vypsat si cely "ps ax", vypsat si vystup ty kolony, "which kill" atd. Ty
hlasky si zapisovat nekam do souboru.
--
Jan Pechanec <jp (at) devnull (dot) cz>
http://www.devnull.cz
More information about the Users-l
mailing list