简体   繁体   English

ssh -ing和编译java程序

[英]ssh -ing and compiling the java program

Hello I need to ssh in one ip address and run my java code through shell script I do it by this way 你好我需要在一个ip地址ssh并通过shell脚本运行我的java代码我这样做

ssh $LINE java -Djava.library.path=/N/u/sbpatil/ds/Project4/demons/Project4Lib -cp "/N/u/sbpatil/ds/Project4/demons:/N/u/sbpatil/ds/Project4/demons/Project4Lib/jug-uuid.jar:/N/u/sbpatil/ds/Project4/demons/Project4Lib/NaradaBrokering.jar:/N/u/sbpatil/ds/Project4/demons/Project4Lib/sigar.jar" PublisherClient >> output2 & 

but output2 file has no output whatsoever.Even if the run command of java is giving me an error,that error should be written in that file.,buts it is not being written. 但是output2文件没有任何输出。即使java的run命令给我一个错误,该错误应该写在该文件中。但是它没有被写入。 Can anybody please tell me how should i write this script? 有人可以告诉我该怎么写这个剧本?

Now it looks like you run ssh in the background, redirecting output into local file. 现在看起来你在后台运行ssh,将输出重定向到本地文件。 Enclose the command line into '': ssh $LINE 'java ... 1>>output2 2>&1 &' 将命令行括起来'': ssh $LINE 'java ... 1>>output2 2>&1 &'

Also using nohup might be a good idea if you launch your app like that. 如果您像这样启动您的应用程序,也可以使用nohup

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM