通过ssh 获取远程服务器sqlite数据库表信息

通过ssh 获取远程服务器sqlite数据库表信息,第1张

概述#!/bin/bash# create by lhb# date 2013-10-29# ssh get romote server sqlite table infoauto_smart_ssh () { expect -c "set timeout -1; spawn ssh -o StrictHostKeyChecking=no $2 ${@:3};
#!/bin/bash# create by lhb# date  2013-10-29# ssh get romote server sqlite table infoauto_smart_ssh () {    expect -c "set timeout -1;        spawn ssh -o StrictHostKeyChecking=no  ${@:3};                expect {                   *assword:* {send -- \r;                        expect {                                *denIEd* {exit 2;}                        eof     }                        }                eof       {exit 1;}                        }                "                        return $?                }                      List="/home/lhb/List.txt"if [ -f "$List" ]; then       rm $Listfitouch $Listdb_path="/home/lhb/data/sqlite.db"hosts=("192.168.38.50" "192.168.38.51" "192.168.38.52")user="lhb"passwd="password"cmd="sqlite3 $db_path 'select vIDeo_ID,vIDeo_name from dopool_vIDeo'"#sqlite3 /home/lhb/data/sqlite.db 'select vIDeo_ID,vIDeo_name from dopool_vIDeo' >> $List#sqlite3 /home/lhb/data/sqlite.db 'select vIDeo_ID,vIDeo_name from dopool_vIDeo'for host_ip in ${hosts[@]}do#auto_smart_ssh $passwd $user@$host_ip $cmd | grep "^[0-9]*|"auto_smart_ssh $passwd $user@$host_ip $cmd | grep "^[0-9]*|" >> $Listdone#auto_smart_ssh '$passwd' dopool@192.168.38.156  "sqlite3 /home/lhb/data/sqlite.db 'select * from dopool_vIDeo'" >> $List#echo -e "\n---Exit Status: $?"           #返回0,说明执行正确
总结

以上是内存溢出为你收集整理的通过ssh 获取远程服务器sqlite数据库表信息全部内容,希望文章能够帮你解决通过ssh 获取远程服务器sqlite数据库表信息所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/sjk/1172571.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-02
下一篇 2022-06-02

发表评论

登录后才能评论

评论列表(0条)

保存