Can I view an 'at' command?

Hi,

One of our users has loads of jobs scheduled. When I do at -l I get a long list of tasks which end in .a
Is there anyway I can view what these commands will do? Also, What's the relationship between the 'at' function and the crontab? I can't see any entries in crontab....Cheers

Check your man page for at - the directories it uses should be listed. On Linux the jobfiles are usually in /var/spool/at.

And on HPUX you would find them in /var/spool/cron/atjobs if correctly formulated (jobs syntax used...) otherwise in /var/spool/cron... the atjobs files are readable...

cron and at are separete commands.(and cron runs with a different enviroment (/etc/crontab))
usually the at cmd, used one times jobs,for exa (test a script at specific times and see what happened)
if it's succesfull that your scheduled job,you can think it as a cron jobs for repeated times.

regards
ygemici

Something that might interest you:

ant:/home/vbe $ at -f /home/vbe/test_at_cmd now+7minutes
warning: commands will be executed using /usr/bin/sh
job 1322836280.a at Fri Dec  2 15:31:20 2011
ant:/home/vbe $ cd /var/spool/cron/atjobs
ant:/var/spool/cron/atjobs $ ll
total 12
-r-Sr-Sr--   1 vbe        bin           6029 Dec  2 15:24 1322836280.a
ant:/var/spool/cron/atjobs $ cd ..
ant:/var/spool/cron $ ll
total 4
-r-Sr-Sr--   1 vbe        bin              0 Dec  2 13:41 _at24347        # these are bad ones...and so dont  
-r-Sr-Sr--   1 vbe        bin              0 Dec  2 13:44 _at24391        # finish in atjobs it seems....
dr-xr-xr-x   2 bin        bin             96 Dec  2 15:24 atjobs
-r--r--r--   1 bin        bin            335 Nov 14  2000 crontab.root
dr-xr-xr-x   2 bin        bin           1024 May 31  2010 crontabs
drwxr-xr-x   2 root       sys             96 Jun 24  2009 save
drwxrwxrwt   2 root       root            96 Dec  2 15:25 tmp

--

ant:/home/vbe $ jobs
[2] + Stopped (tty input)      nohup at now+2minutes ./test_at_cmd&
[1] - Stopped (tty input)      at now+5minutes ./test_at_cmd&

ant:/var/spool/cron/atjobs $ more 1322836280.a
: at job
export LANG; LANG=C
export _; _=/usr/bin/at
export MANPATH; MANPATH=/usr/share/man/%L:/usr/share/man:/usr/contrib/man/%L:/us
r/contrib/man:/usr/local/man/%L:/usr/local/man:/opt/upgrade/share/man/%L:/opt/up
grade/share/man:/opt/pd/share/man/%L:/opt/pd/share/man:/opt/pd/share/man/%L:/opt
/pd/share/man:/opt/pd/share/man/%L:/opt/pd/share/man:/opt/ignite/share/man/%L:/o
pt/ignite/share/man:/opt/mx/share/man:/usr/dt/share/man:/opt/samba/man:/opt/perf
/man/%L:/opt/perf/man:/opt/OV/man/itose/%L:/opt/OV/man/itose:/opt/prm/man/%L:/op
etc...
export EDITOR; EDITOR=vi
export HISTFILE; HISTFILE=/home/vbe/.sh_history
export LOGNAME; LOGNAME=vbe
export MAIL; MAIL=/var/mail/vbe
export MOZILLA_HOME; MOZILLA_HOME=/opt/mozilla
export USER; USER=vbe
export XFORCE_INTERNET; XFORCE_INTERNET=True
export SHELL; SHELL=/usr/bin/ksh
export HISTSIZE; HISTSIZE=18432
export TMOUT; TMOUT=0
export HOME; HOME=/home/vbe
export A__z; A__z=-5TMOUT
# @(#)B.11.11_LR
cd /home/vbe
ulimit unlimited
umask 2
#!/usr/bin/ksh
HOME=/home/vbe

cd $HOME
echo "PWD "$PWD >$HOME/at_test.out
. $HOME/profile_cron
/usr/bin/touch $HOME/at_test.out
echo "Im " $(id) >&1
/usr/bin/umask >&1
/usr/bin/newgrp >&1
echo "Im " $(id) >&1

1322836280.a: END
----

ant:/var/spool/cron/atjobs $ date;ll
Fri Dec  2 15:31:54 MET 2011
total 0
ant:/home/vbe $ date;jobs
Fri Dec  2 15:32:21 MET 2011
[2] + Stopped (tty input)      nohup at now+2minutes ./test_at_cmd&
[1] - Stopped (tty input)      at now+5minutes ./test_at_cmd&

So it may be what you see are unsuccessful attempt at trying to use at...
Needs cleaning (and I have also now...)
In my case its simple:

ant:/home/vbe $ date;jobs
Fri Dec  2 15:32:21 MET 2011
[2] + Stopped (tty input)      nohup at now+2minutes ./test_at_cmd&
[1] - Stopped (tty input)      at now+5minutes ./test_at_cmd&
ant:/home/vbe $ fg
nohup at now+2minutes ./test_at_cmd
                                                                    # Did a Ctrl-c
you have mail in /var/mail/vbe
ant:/home/vbe $ jobs
[1] + Stopped (tty input)      at now+5minutes ./test_at_cmd&
ant:/home/vbe $ fg
at now+5minutes ./test_at_cmd
                                                                   # Did a Ctrl-c
ant:/home/vbe $ jobs
ant:/home/vbe $