[root@CCNWEB18 niezhenqun]# rpm -ivh expect-5.43.0-5.1.x86_64.rpm
warning: expect-5.43.0-5.1.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:expect ########################################### [100%]
[root@CCNWEB18 niezhenqun]# rpm -ivh expect-devel-5.43.0-5.1.x86_64.rpm
warning: expect-devel-5.43.0-5.1.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:expect-devel ########################################### [100%]
[root@CCNWEB18 CCTIWWEB_BACKUP]# cat CCTIWWEB_BACKUP.sh
#!/bin/bash
rm -f /opt/CCTIWWEB_BACKUP/CCTIWWEB_BACKUP.tar.gz
/bin/tar -czf /opt/CCTIWWEB_BACKUP/CCTIWWEB_BACKUP.tar.gz /opt/IBM/HTTPServer/htdocs/en_US/training/ /opt/IBM/HTTPServer/htdocs/en_US/upload/ /opt/IBM/HTTPServer/htdocs/en_US/view/
/opt/CCTIWWEB_BACKUP/expect.sh
[root@CCNWEB18 CCTIWWEB_BACKUP]# cat expect.sh
#!/usr/bin/expect -f
set timeout -1
spawn /usr/bin/scp -P 10022 -l 25000 /opt/CCTIWWEB_BACKUP/CCTIWWEB_BACKUP.tar.gz
expect " password:"
send ""
expect "100%"
send "sleep1\n"
阅读(1141) | 评论(0) | 转发(0) |