fixunix
Tags Register FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read

Using "at" command - Networking

This is a discussion on Using "at" command - Networking ; 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 ...


Fix Unix > Linux > Help > Networking > Using "at" command

Reply
 
LinkBack Tools
  #1  
Old 03-26-2008, 09:41 PM
Junior Member
 
Join Date: Sep 2009
Posts: 0
Default Using "at" command

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
The contents of the 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
  #2  
Old 03-26-2008, 09:49 PM
Junior Member
 
Join Date: Sep 2009
Posts: 0
Default Re: Using "at" command

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
> The contents of the 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
  #3  
Old 03-27-2008, 11:55 PM
Junior Member
 
Join Date: Sep 2009
Posts: 0
Default Re: Using "at" command

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 | 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 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
> The contents of the 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
  #4  
Old 03-28-2008, 04:04 AM
Junior Member
 
Join Date: Sep 2009
Posts: 0
Default Re: Using "at" command

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
  #5  
Old 04-01-2008, 08:57 AM
Junior Member
 
Join Date: Sep 2009
Posts: 0
Default Re: Using "at" command

R C V 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
> The contents of the 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

Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: [openssl.org #1109] Please urgently impelment "-utf8" parameter in "openssl ca" command unix Openssl 0 10-07-2007 06:21 PM
[openssl.org #1109] Please urgently impelment "-utf8" parameter in "openssl ca" command unix Openssl 0 10-07-2007 06:21 PM
[openssl.org #1109] Please urgently impelment "-utf8" parameter in "openssl ca" command unix Openssl 0 10-07-2007 06:21 PM
[openssl.org #1109] Please urgently impelment "-utf8" parameter in "openssl ca" command unix Openssl 0 10-07-2007 06:20 PM
[openssl.org #1109] Please urgently impelment "-utf8" parameter in "openssl ca" command unix Openssl 0 10-07-2007 06:14 PM


All times are GMT. The time now is 10:16 AM.