Solaris / OpenSolarisThis forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Today I was trying to remember the syntax of the 'at' command so I could schedule a task that is typically scheduled by cron but needs to be run _sooner_ than the crontab specifies because of some server downtimes at my job (there was a power outage at one of our server locations over the weekend, due to a building being demolished nearby).
Embarrassingly, I couldn't remember the correct syntax, and the things it is doing on my local machine (Solaris 10) are kinda mystifying to me ... & I'd like to understand better so I can use this utility with some confidence.
I suspect my confusion may have to do with where stdout is going ...
My first stabs involved just trying to get something echo'd to the terminal:
art-16: at now + 1 minute
at> echo whee
at> <EOT>
commands will be executed using /bin/tcsh
job 1218471623.a at Mon Aug 11 12:20:23 2008
I expected to wait approximately 60 seconds and see "whee" echoed to the terminal, but this sequence echoes nothing ... I do, however, get emails from the system that look like this (the special chars do not quite carry over):
Your "at" job on art
"/var/spool/cron/atjobs/1218465682.a"
produced the following output:
]2;art:/home/skutch]1;skutch
If I redirect the output to a file, the file gets created and has the correct contents:
art-17: at now + 1 minute
at> echo whee > whee.txt
at> <EOT>
commands will be executed using /bin/tcsh
job 1218471815.a at Mon Aug 11 12:23:35 2008
art-18: ls whee.txt
whee.txt
art-19: cat !$
cat whee.txt
whee
I have found several suggestions online that this is the best way to fire off a timed command:
echo "/this/is/my/command" | at now + 1 hour
... with whatever time specification is desired. Perhaps I am worrying needlessly, when the usually cronned commands in question don't need to echo anything out to stdout anyway ... I was just a little mystified by this.
Thanks for any clarifications ... hope this isn't too silly a matter.
The at command does have an attached terminal, so it cannot output to your terminal. Imagine all sorts of backgrounded jobs dumping output on your terminal while you were typing or editing a document.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.