有没有人可以分享一个java代码的工作示例,它可以将文件从windows机器复制到远程linux服务器? 我有以下shell命令,我试图包含在java代码 -
FILEPATH="/E/Result"
cd $REPORTPATH
COPYPATH="/home/hadoop/results"
echo $COPYPATH
LATEST=`ls -lrth | grep -i *.csv | tail -1 | awk '{print $9}'
echo $LATEST
scp -i /C/Users/.ssh/id_rsa -oStrictHostKeyChecking=no $FILEPATH/$LATEST user@IP:$COPYPATH
答案 0 :(得分:-1)