Greetings...

Best way is if you are launching them in the first place, then have the
programs internally check the time and shutdown themselves down when it is
6am.  Personally, I prefer this method as it allows you a clean orderly
shutdown.

        sleep 300;
        &shutdown if( (localtime())[2] == 5 );
rinse and repeat...

- or -

Have the programs write their PID to files in a specific location.  Open the
file(s) and you have the PIDs to kill them.

- or -

Pull in the results from ps and parse out the information you need.

        @ps = `ps -ef`;

        foreach(@ps)

...and so on...


Jeremy Elston
Sr. Staff Unix System Administrator
Electronic Brokerage Technology
Charles Schwab & Co., Inc.
(602.431.2087 [EMAIL PROTECTED])

"Life is the final exam where no one can cheat, because we all have
different problems to solve."

WARNING:  All email sent to this address will be received by the Charles
Schwab Corporate email system and is subject to archival and review by
someone other than the recipient

-----Original Message-----
From: Dan Jablonsky [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 14, 2001 5:40 PM
To: [EMAIL PROTECTED]
Subject: [Perl-unix-users] kill a process


Hi all,
I need to kill a dozen perl programs running
simultaneously. I would like to kill them every
morning after 6 am but I don't know how to reference
the 12 programs. Usually I use kill PID, but in this
case I don't know the PID. If I do a ps -al I can see
that all perl programs have CMD perl. How do I kill a
process knowing its CMD?
Thanks a lot,
Dan

__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/
_______________________________________________
Perl-Unix-Users mailing list. To unsubscribe go to
http://listserv.ActiveState.com/mailman/subscribe/perl-unix-users
_______________________________________________
Perl-Unix-Users mailing list. To unsubscribe go to 
http://listserv.ActiveState.com/mailman/subscribe/perl-unix-users

Reply via email to