- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Is there a log for commands ran via 'at now'
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2011 07:50 AM
тАО02-02-2011 07:50 AM
Is there a log for commands ran via 'at now'
Is there a log similar to /var/adm/cron/log for commands ran by 'at now'?
For example, is there a way to find the
command line listed below after the command runs?
at now {return}
/home/my_shell_script.sh yes 4711 {return}
{CTRL D}
Thanks,
Ray
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2011 08:02 AM
тАО02-02-2011 08:02 AM
Re: Is there a log for commands ran via 'at now'
#at -l
You will see output such as:
job 8745156.a at wed Sep 17 11:00:00 2010
Rgds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2011 08:05 AM
тАО02-02-2011 08:05 AM
Re: Is there a log for commands ran via 'at now'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2011 08:23 AM
тАО02-02-2011 08:23 AM
Re: Is there a log for commands ran via 'at now'
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2011 08:44 AM
тАО02-02-2011 08:44 AM
Re: Is there a log for commands ran via 'at now'
For example:
# at now +2 minute
ls -lt > ./somefile.txt
warning: commands will be executed using /usr/bin/sh
job 1296664522.a at Wed Feb 2 17:35:22 2011
tail /var/adm/cron/log
< root 9766 c Wed Feb 2 17:35:00 MET 2011
> CMD: 1296664522.a
> root 9785 a Wed Feb 2 17:35:22 MET 2011
< root 9785 a Wed Feb 2 17:35:22 MET 2011
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2011 08:51 AM
тАО02-02-2011 08:51 AM
Re: Is there a log for commands ran via 'at now'
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2011 08:52 AM
тАО02-02-2011 08:52 AM
Re: Is there a log for commands ran via 'at now'
Jeff Traigle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2011 09:28 AM
тАО02-02-2011 09:28 AM
Re: Is there a log for commands ran via 'at now'
cron entries show the entire command line:
> CMD: /opt/sfm/bin/restart_sfm.sh
> root 12573 c Wed Feb 2 04:05:00 MET 2011
< root 12573 c Wed Feb 2 04:05:03 MET 2011
'at now' shows only the the job identifier:
> CMD: 1296664522.a
> root 9785 a Wed Feb 2 17:35:22 MET 2011
< root 9785 a Wed Feb 2 17:35:22 MET 2011
Makes me wonder if there is a configuration missing somewhere.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2011 09:43 AM
тАО02-02-2011 09:43 AM
Re: Is there a log for commands ran via 'at now'
. . .
An at or batch job consists of a two-part script stored in /var/spool/cron/atjobs that can be executed by the POSIX shell. The first part sets up the environment to match the environment when the at or batch command was issued. The second part consists of the commands that you entered.
. . .
That's how at works and that's why all you see is the job-id. As I said before, I'm not sure what else you wish to see, but if you alter the command that you are at'ing to do it's own logging then you can log anything you wish.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2011 12:50 PM
тАО02-02-2011 12:50 PM
Re: Is there a log for commands ran via 'at now'
Always use crontab vs at(1)?
at(1) does have a benefit of saving your environment but not your aliases.