Revision 125 (by dpavlin, 2009/12/29 13:03:45) dump atq output *together* with commands which will be executed
#!/usr/bin/perl

use warnings;
use strict;

use File::Slurp;

# from at.c "%c%5lx%8lx"

foreach my $file ( glob '/var/spool/cron/atjobs/*' ) {

	my $cmd = read_file $file;

	$file =~ s{^.+/([^/]+)$}{$1} || die "can't strip path";

	my $queue =     substr $file, 0, 1;
	my $jobno = hex substr $file, 1, 5;
	my $timer = hex substr $file, 6;

	print "## $file -> $queue $jobno $timer\n$cmd\n";

}