开发者_运维问答I am not able to send commands to the server. However the connection is established and I am able to do the simple operations like "rm /usr/testfile". When I try to execute the command like "tail -f /opt/logs/applications/db/cbss.log >> cbsslog_tailed". Please help me to execute the tail command through java code.
It looks like you want to do I/O redirection in Linux via Java shell command execution support running from a server. Please refer to the link below on how to solve redirection problem:
http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html?page=4
The sample programs in the link above are used in Windows environment. But, I think it could be ported to Linux without any problem.
精彩评论