摘要:
手头上有一个远程重启目标服务器上进程的expect脚本,SHELL下单独执行时一切都OK,但是添加到cron任务中时执行却不能工作。部分代码如下:expect脚本:(/data/home/restart_expect)#!/usr/bin/expect spawn ssh -pxxxroot@xxx.xxx.xxx.xxx #expect "*root's password*" expect "*Tencent:*" send "sh some remote scripts" send "exit/n" e 阅读全文