Starting script using ssh keeping nohup output on remote? - SSH

This is a discussion on Starting script using ssh keeping nohup output on remote? - SSH ; Hi, I am trying to launch a command through ssh. I use something like ssh -i user@host 'export REMOTE=myname; nice nohup ./my-restart' The problem is that the output appears on the local server where I ran this command and not ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Starting script using ssh keeping nohup output on remote?

  1. Starting script using ssh keeping nohup output on remote?

    Hi,

    I am trying to launch a command through ssh.

    I use something like

    ssh -i user@host 'export REMOTE=myname; nice nohup ./my-restart'

    The problem is that the output appears on the local server where I ran
    this command and not on the remote machine.

    If I run the command "nice nohup ./my-restart &" on the remote machine
    directly then the nohup.out file is created and the output appears
    there. This is what I want.

    Also I find that if I put a & into the ssh command above then the
    command doesn't work.

    Any Ideas? If this isn't the best place to post this then please
    advise as to the best spot.

    Thank you,

    Fu-Tung

  2. Re: Starting script using ssh keeping nohup output on remote?

    Fu wrote:
    > Hi,
    >
    > I am trying to launch a command through ssh.
    >
    > I use something like
    >
    > ssh -i user@host 'export REMOTE=myname; nice nohup ./my-restart'
    >
    > The problem is that the output appears on the local server where I ran
    > this command and not on the remote machine.
    >
    > If I run the command "nice nohup ./my-restart &" on the remote machine
    > directly then the nohup.out file is created and the output appears
    > there. This is what I want.
    >
    > Also I find that if I put a & into the ssh command above then the
    > command doesn't work.
    >
    > Any Ideas? If this isn't the best place to post this then please
    > advise as to the best spot.
    >
    > Thank you,
    >
    > Fu-Tung



    ssh user@host 'export REMOTE=myname; nice nohup ./my-restart >
    logfile.log 2>&1 &'

  3. Re: Starting script using ssh keeping nohup output on remote?

    Perfect! Thank you Chuck!!!!!

    Fu-Tung

    >
    > ssh user@host 'export REMOTE=myname; nice nohup ./my-restart >
    > logfile.log 2>&1 &'- Hide quoted text -
    >
    > - Show quoted text -



+ Reply to Thread