Path: utzoo!attcan!uunet!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!julius.cs.uiuc.edu!ux1.cso.uiuc.edu!iuvax!kinzler From: kinzler@iuvax.cs.indiana.edu (Steve Kinzler) Newsgroups: comp.sources.wanted Subject: Re: Crontab organizer (including remote hosts) Message-ID: <60066@iuvax.cs.indiana.edu> Date: 24 Sep 90 17:21:21 GMT Sender: kinzler@iuvax.cs.indiana.edu Lines: 50 Written by painter@sequoia.execu.com in news:comp.sources.wanted --------- "Crontab organizer (including remote hosts)" ------- > I'm debating writing a program that takes one (or more) crontabs > and puts out an ordered schedule. This is for the sysadmin to > be able to find out what's happening on the system at a particular > time, so that he can schedule routine maintenance. I doubt this is exactly what you're looking for, but it may be a start. It outputs a table of how many cron commands are begun each minute of the day. It doesn't pay any attention to day or month specifications though. from the brain of Steve Kinzler /o)\ kinzler@iuvax.cs.indiana.edu an organ with a mind of its own \(o/ {ames,rutgers}!iuvax!kinzler --- cut here --- #!/usr/bin/perl # crontable - output a day's timetable with the number of cron events each # minute # input is a crontab file # Steve Kinzler, kinzler@cs.indiana.edu, July 1990 while (<>) { /^\s*#/ && next; ($min, $hr, $day, $mon, $wkday, $cmd) = split(/[ \t]+/, $_, 6); $min = '0-59' if $min eq '*'; $hr = '0-23' if $hr eq '*'; $min =~ s/-/../g; $hr =~ s/-/../g; foreach $min (eval "($min)") { foreach $hr (eval "($hr)") { $table{$min, $hr}++; } } } print ' '; foreach $hr (0..23) { printf "%3d", $hr; } print "\n ------------------------------------------------------------------------\n"; foreach $min (0..59) { printf "%2d |", $min; foreach $hr (0..23) { printf "%3d", $table{$min, $hr}; } print "\n"; }