I'm trying to start a proccess on remote server with ssh. I need to log stdout on target server (not the local one)
Here is the script:
sshpass -p mypwd ssh root@myserver.com nohup java -jar /tmp/jenkins/myjar.jar > log.log 2>&1 &
Process starts fine, but logs are created on local server. Checked with
find . -name 'log.log'
I tried to wrap nohup command to double quotes
sshpass -p mypwd ssh root@myserver.com "nohup java -jar /tmp/jenkins/myjar.jar > log.log 2>&1 &"
Process starts fine, but no logs are present on both servers.
How can I make nohup send stdout to log file on remote server?
log.log
file on the server, or have failed if creating the file was impossible. Are you sure you know the directory where the command run? Did you look in the right directory? What if you redirected to a file with absolute path? – Kamil Maciorowski Jan 14 '19 at 12:47