#!/usr/local/bin/expect -f set timeout -1 set UFEIpAddr “” set User “” set UFEPwd "" set UFEDBPwd "" set SMNIpAddr "" set SMNPwd "" set SMNDBPwd "" spawn ssh [email protected]$UFEIpAddr expect { "yes/no" { send "yes\n"; expect "*assword:" { send "$UFEPwd\n" } } "*assword:" { send "$UFEPwd\n"; } } expect "]#" send "mysql -uroot -p$UFEDBPwd -e ‘delete from cc.search_records; delete from cc.tasks;delete from tt.fileinfo; delete from tt.taskinfo;‘\r" expect "]#" send \003 spawn ssh [email protected]$SMNIpAddr expect { "yes/no" { send "yes\n"; expect "*assword:" { send "$SMNPwd\n" } } "*assword:" { send "$SMNPwd\n"; } } expect "]#" send "mysql -uroot -p$SMNDBPwd -e ‘delete from scc.taskrecord; delete from scc.localvideorecord; delete from scc.videorecord;‘\r echo ‘DELED‘\r" expect "]#" send \003
时间: 2024-10-14 06:22:31