Board logo

标题: [文件操作] 求助如何向多台liunx电脑发送指定文件 [打印本页]

作者: sxudong    时间: 2013-3-19 23:33     标题: 求助如何向多台liunx电脑发送指定文件

工作上我们要更新软件文件,每次都需手动更改,有写一简单的批处理,仍想求更高效率。

liunx电脑的用户名是:ope,密码:operator

自己简单小批处理如下:
b.txt文件内容,查看机器号:
open 10.83.19.147
ope
operator
cd lts/system/config
get tester.conf
by


c.txt文件内容,上传tss.zip压缩文件:
puase
open 10.83.19.147
ope
operator
cd ltsback
bin
put tss.zip
puase

执行的批处理文件auto update.bat:
@echo ************************升级开始********************

ftp -s:b.txt
@echo ************************瞄哈下面tester ID ,不对就干掉程序********************
echo.
type tester.conf | find "Station" & type tester.conf | find "TesterID" || type tester.conf
type tester.conf | find "HostName"
@pause
del tester.conf
ftp -s:c.txt
@echo ************************大功告成!!!***************
@pause

想可以同时实现多台电脑的批理上传文件。希望有人能帮助到我。谢谢了!
作者: Batcher    时间: 2013-3-19 23:39

可以考虑用shell脚本来实现:
如果多台Linux之间建立了ssh信任,可以用scp
如果没有建立ssh信任,可以用expect




欢迎光临 批处理之家 (http://www.bathome.net/) Powered by Discuz! 7.2