Created
May 13, 2014 18:29
-
-
Save waffle2k/b036110d743e6efbc229 to your computer and use it in GitHub Desktop.
run via "watch watch-ps.pl" to view the process tree of the cron jobs running on a machine...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -w | |
use strict; | |
my $search = shift || 'CRON'; | |
my $following = 0; | |
for (`ps auxwwf`){ | |
chomp; | |
$following++ if /$search/; | |
if ( /\_/ ){ | |
print "$_\n" if $following; | |
} | |
else { | |
$following=0 unless /$search/; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment