linux定时删除日志脚本功能

版权声明:欢迎分享转载 我可能会失败,但我不会一直失败 https://blog.csdn.net/u012637358/article/details/86703956

#!/usr/tcl/bin/expect -f
 for {set i 14} {$i < 24} {incr i} {
     spawn ssh [email protected].$i
     expect {
        "*password:*" {
        send "123456\r"
        exp_continue
            }
        "*yes/no)?*" {
        send "yes\r"
        exp_continue
        }
    }
    expect "]# "
    send "rm -rf /usr/hdp/2.5.3.0-37/spark2/work/*\r"
    send "exit\r"
    expect eof
 }

猜你喜欢

转载自blog.csdn.net/u012637358/article/details/86703956