#!/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";

}
