#307213 at: a crumby lister for a crumby at(1)

Package:
at
Source:
at
Description:
Delayed job execution and batch processing
Submitter:
Dan Jacobson
Date:
2010-01-04 16:13:54 UTC
Severity:
wishlist
#307213#3
Date:
2005-04-27 03:28:10 UTC
From:
To:
Here's a program that you might include with Debian's at.

#!/usr/bin/perl
# atjoblister -- a crumby lister for a crumby at(1)
# Copyright       : http://www.fsf.org/copyleft/gpl.html
# Author          : Dan Jacobson,  http://jidanni.org/
# Created On      : Wed Apr 27 00:24:47 2005
# Last Modified On: Wed Apr 27 11:29:01 2005
# Update Count    : 66
#No more going bananas trying to figure out what file is what at job
#with Debian's Thomas Koenig' atq(1).  Must be root to run.
use warnings;
use strict;
use Date::Format;
chdir "/var/spool/cron/atjobs" or die;
print "File - Job# - Date\n";
for ( `ls|sort -k 1.7` ) { #How do the pros do that all in perl?
  chomp;
  /a(.....)(........)/;
  printf "$_ - %s - %s", oct "0x$1", ctime( ( oct "0x" . $2 ) * 60 );
}
#Maybe Koenig's at is good, but it sure isn't user friendly.

#307213#8
Date:
2008-02-01 22:53:06 UTC
From:
To:
Here's a workaround I use

#!/usr/bin/perl
# atq-verbose -- else no way to tell which file is which atq job
# Copyright       : http://www.fsf.org/copyleft/gpl.html
# Author          : Dan Jacobson http://jidanni.org/
# Created On      : Wed Jan 30 02:52:56 2008
# Last Modified On: Sat Feb  2 06:50:27 2008
# Update Count    : 69
#http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=307213
use strict;
use warnings FATAL => 'all';
chdir "/var/spool/cron/atjobs" or die $!;
my ( %date, %file );
for ( glob "*" ) {
    /^a(.....)(........)$/ or die $!;
    $date{$1} = $2;
    $file{$1} = $_;
}
for ( sort { $date{$a} cmp $date{$b} } keys %date ) {
    print $file{$_}, " ", hex $_, " ", scalar localtime( 60 * hex $date{$_} ),
      "\n";
}

#307213#13
Date:
2008-03-06 22:26:38 UTC
From:
To:
Oops. This version now gets all queues:

#!/usr/bin/perl
# atq-verbose -- else no way to tell which file is which atq job
# Copyright       : http://www.fsf.org/copyleft/gpl.html
# Author          : Dan Jacobson http://jidanni.org/
# Created On      : Wed Jan 30 02:52:56 2008
# Last Modified On: Fri Mar  7 06:23:15 2008
# Update Count    : 71
#http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=307213
use strict;
use warnings FATAL => 'all';
chdir "/var/spool/cron/atjobs" or die $!;
my ( %date, %file );
for ( glob "*" ) {
    /^.(.....)(........)$/ or die $!;
    $date{$1} = $2;
    $file{$1} = $_;
}
for ( sort { $date{$a} cmp $date{$b} } keys %date ) {
    print $file{$_}, " ", hex $_, " ", scalar localtime( 60 * hex $date{$_} ),
      "\n";
}