#!/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数据库表信息所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)