An approach that would work equally well on solaris and linux would be one that scans /proc, figures out which processes belong to you, and which of your processes are older than the shell from which the current perl process is running. This can be done simply in at least a couple different ways, using opendir or just parsing the output of `ls -l /proc | grep myname`.

Of course, if you happen to run any jobs that are supposed to keep going for days in the background, you might want something like a dot file in your home directory that the killer script can look for, to know which jobs to leave alone (and have a substitute or wrapper for "nohup" that puts pids into such a file). Have fun with that.

Update:Duh -- just realized I was wrong to think that ls -ld /proc/[1-9]* could tell you how old the jobs are on linux; this does to work on solaris, at least.


In reply to Re: Killing multiple logins. by graff
in thread Killing multiple logins. by DigitalKitty

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.