Networking Forums

Networking Forums > Computer Networking > Linux Networking > Using "at" command

Reply
Thread Tools Display Modes

Using "at" command

 
 
R C V
Guest
Posts: n/a

 
      03-26-2008, 08:41 PM
hello,
I wanted to schedule jobs to start within a space of few
seconds of each other. But 'at' is giving me a resolution of 'min'.
So I decided to put all tasks in a file and invoke

at -f <filename>
The contents of the <filename> are:
at now+1 minute "ls -l"
at now+2 minute "date"

But I get a error "Garbled time"

Can you tell me what is wrong here..Also is it possible to give
interval in seconds.

TIA,
R C
 
Reply With Quote
 
 
 
 
Lew Pitcher
Guest
Posts: n/a

 
      03-26-2008, 08:49 PM
R C V wrote:

> hello,
> I wanted to schedule jobs to start within a space of few
> seconds of each other. But 'at' is giving me a resolution of 'min'.
> So I decided to put all tasks in a file and invoke
>
> at -f <filename>
> The contents of the <filename> are:
> at now+1 minute "ls -l"


echo ls -l | at now + 1 minute

> at now+2 minute "date"


echo date | at now + 2 minutes

> But I get a error "Garbled time"
>
> Can you tell me what is wrong here..


1) at reads stdin (or a named file) for the commands to execute
2) the time qualifier needs spaces between each of its components

> Also is it possible to give interval in seconds.


No. Time units can be minutes, hours, days, or weeks. Seconds are not
recognized as time units

> TIA,
> R C


--
Lew Pitcher

Master Codewright & JOAT-in-training | Registered Linux User #112576
http://pitcher.digitalfreehold.ca/ | GPG public key available by request
---------- Slackware - Because I know what I'm doing. ------


 
Reply With Quote
 
R C V
Guest
Posts: n/a

 
      03-27-2008, 10:55 PM
It works when I pipe the command to 'at'

so $ date | at now + 2 minutes works well.
but
a) $ ls -l | at now + 2 minutes accepts the job, but gives a very
strange output in /var/spool/mail/root....

b) $killall <exec name> | at now + 2 minutes results in killall
getting executed immediately...

Am I missing something while using 'at' with those commands which have
some parameters/switches.
Also how do I get the output on the screen instead of .../mail/root..

Thanks,
R C
On Mar 26, 2:41 pm, R C V <rss...@gmail.com> wrote:
> hello,
> I wanted to schedule jobs to start within a space of few
> seconds of each other. But 'at' is giving me a resolution of 'min'.
> So I decided to put all tasks in a file and invoke
>
> at -f <filename>
> The contents of the <filename> are:
> at now+1 minute "ls -l"
> at now+2 minute "date"
>
> But I get a error "Garbled time"
>
> Can you tell me what is wrong here..Also is it possible to give
> interval in seconds.
>
> TIA,
> R C


 
Reply With Quote
 
Bit Twister
Guest
Posts: n/a

 
      03-28-2008, 03:04 AM
On Thu, 27 Mar 2008 16:55:20 -0700 (PDT), R C V wrote:
> It works when I pipe the command to 'at'
>
> a) $ ls -l | at now + 2 minutes accepts the job, but gives a very
> strange output in /var/spool/mail/root....


> Am I missing something while using 'at' with those commands which have
> some parameters/switches.


They all executed immediately. Any output they created were given to at.

I would recommend putting any complex commands in a file
and submit the file via at.


> Also how do I get the output on the screen


Redirect results in a file and use xmessage I guess. Example:

echo "ls > ls.result
xmessage -display :0 -f ls.result
" > at.job
at -f at.job now+2minutes

> instead of .../mail/root..


Redirect results in a file. Example:
echo "ls > ls.result" > at.job
at -f at.job now+2minutes
 
Reply With Quote
 
Chris Davies
Guest
Posts: n/a

 
      04-01-2008, 08:57 AM
R C V <(E-Mail Removed)> wrote:
> I wanted to schedule jobs to start within a space of few
> seconds of each other.


Separate them using sleep(1)

> But 'at' is giving me a resolution of 'min'.


Yes. So use at(1) to schedule the group

> So I decided to put all tasks in a file and invoke


> at -f <filename>
> The contents of the <filename> are:
> at now+1 minute "ls -l"
> at now+2 minute "date"


Arrgghh. You're using at(1) to schedule at(1)!? There are occasions when
this makes sense, but this isn't one of them.

at 10pm <<!
task1 >/tmp/task1.out 2>/tmp/task1.err &
sleep 5
task2 >/tmp/task2.out 2>/tmp/task2.err &
sleep 5
task3 >/tmp/task3.out 2>/tmp/task3.err &
wait
!

Chris
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Fwd: SPEWS DOLTS "SneakyP", "Kevin!:?)", "WindsorFox" SPAM braodbandnewsgroup] !:?) Broadband 0 11-30-2005 01:04 AM
Re: SPEWS SLIMES "WindsorFox", "Kevin-!:?)", "Spin Dryer" get the cold shoulder at broadband ng! SneakyP Broadband 0 11-29-2005 10:46 PM
Attention Plus.net Re: SPEWS DOLTS "WindsorFox", "Kevin-!:?)", "SpinDryer" SPAM broadband newsgroup !:?) Broadband 0 11-28-2005 04:28 AM
Attention Plus.Net Re: SPEWS DOLTS "WindsorFox", "Kevin-!:?)", "SpinDryer" SPAM braodband newsgroup !:?) Broadband 0 11-28-2005 03:03 AM
"brctl" command not working, how to create "brctl" file? santa19992000@yahoo.com Linux Networking 1 06-05-2005 12:38 AM



1 2 3 4 5 6 7 8 9 10 11