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 ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: Using "at" command

  1. 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

  2. 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. ------



  3. 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



  4. 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

  5. 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 to Thread