Revision 125

Date:
2009/12/29 13:03:45
Author:
dpavlin
Revision Log:
dump atq output *together* with commands which will be executed
Files:

Legend:

 
Added
 
Removed
 
Modified
  • trunk/atq.pl

     
    1 #!/usr/bin/perl
    2
    3 use warnings;
    4 use strict;
    5
    6 use File::Slurp;
    7
    8 # from at.c "%c%5lx%8lx"
    9
    10 foreach my $file ( glob '/var/spool/cron/atjobs/*' ) {
    11
    12 my $cmd = read_file $file;
    13
    14 $file =~ s{^.+/([^/]+)$}{$1} || die "can't strip path";
    15
    16 my $queue = substr $file, 0, 1;
    17 my $jobno = hex substr $file, 1, 5;
    18 my $timer = hex substr $file, 6;
    19
    20 print "## $file -> $queue $jobno $timer\n$cmd\n";
    21
    22 }