Re: using "at" and ssh




> Cloud Burst <DoNotReplyViaEmail@xxxxxxxxxxx> wrote:
> This is great stuff. Thanks a lot.
> Almost there, but I still have one problem. I can't seem to get what I
> put in the background to work properly. For example, I have a little
> test script called foo that looks like this:
>
> % cat foo
> ssh myhost ls
>
> Then if I do this:
>
> % ./foo > ls.txt
>
> ...works fine. But:
>
> % ./foo > ls.txt &
>
> ...doesn't. It is immediately stopped by bash. I then have to "fg" it
> and press the Enter key. It then runs.
>
> I tried this with my big script and
>
> What I REALLY want to do is run my job like this: "nohup mybigjob &" but
> it behaves the same way. It runs fine until it gets to the first command
> that uses ssh. It is then stopped by bash, I have to put in foreground
> and hit the Enter key. It then takes off and the command succeeds, as
> well as all the rest of the commands in the script that use ssh.
>
> Is there a way around this?


Try:
ssh -n myhost ls > ls.txt &
























.



Relevant Pages

  • Scripts using SSH and SSH_ASKPASS
    ... To test SSH scripts you better destroy the control TTY. ... The trick is to run YOUR script on YOUR local ... As for the password relaying command: this needs not be an X command. ... # we read one line from a temporary pipe. ...
    (comp.security.ssh)
  • Re: remote server backup script
    ... > Just type away at the command line. ... Make a backup of whatever you want ... > command line, in a script. ... >>the server ssh key on the clients machine). ...
    (comp.os.linux.misc)
  • Re: [PHP] SSH and php
    ... % % Is it possible to run a SSH command from php? ... it's possible to run any command from php. ... There are ways to do that -- I personally would create a kick script ...
    (php.general)
  • Re: Debugging gvim :!cmd with bash
    ... > I've simplified the problem to a trivial script. ... If I invoke it from an xterm command line, ... If that's true for bash, ...
    (comp.unix.shell)
  • Using SSH to terminate remote systems for disaster recovery
    ... I have a need to terminate a number of AIX 5.1 systems ... from a single script. ... I can do this using ssh. ... if I issue the shutdown command from ssh, ...
    (AIX-L)