expect脚本同步文件我们知道主机间传输一个文件受网络、文件大小和磁盘读写速率的影响,在传输一个文件时不可能一下子马上传输到对方,但是使用expect脚本的过程中,值得注意的是在脚本结尾以expecteof结束整个脚本,它的作用是当脚本内涉及到有文件传输时,会让文件传输完成后再彻底结束掉脚本进程,这样会让文件能够成功传输到对方主机上。expect若使用exit或者没有eof这个选项,那么在执行脚
                            
                            
                                分类:
其他好文   时间:
2018-09-27 15:34:51   
                                阅读次数:
211
                             
                         
                    
                        
                            
                            
                                expect脚本当中去把一台机器的文件同步到另外一台机器上去,自动同步文件[root@100xuni1sbin]#vim4.expect##编辑脚本写入一下内容:#!/usr/bin/expectsetpasswd"hanshuo"spawnrsync-avroot@192.168.63.101:/tmp/12.txt/tmp/expect{"yes/no"{send"yes\r"}"passwo
                            
                            
                                分类:
其他好文   时间:
2018-09-25 16:36:51   
                                阅读次数:
172
                             
                         
                    
                        
                            
                            
                                expect脚本同步文件、expect脚本指定host和要同步的文件、构建文件分发系统、批量远程执行命令
                            
                            
                                分类:
其他好文   时间:
2018-08-01 00:22:45   
                                阅读次数:
177
                             
                         
                    
                        
                            
                            
                                一、expect脚本同步文件1、vi1.expect内容如下:#!/usr/bin/expectsetpasswd"123456"spawnrsync-avroot@192.168.1.31:/tmp/12.txt/tmp/expect{"yes/no"{send"yes\r"}"password:"{send"$passwd\r"}}expecteof#expecteof的作用是等待脚本中的命令
                            
                            
                                分类:
其他好文   时间:
2018-07-23 11:18:57   
                                阅读次数:
148
                             
                         
                    
                        
                            
                            
                                一、expect脚本同步文件实例4:自动同步文件[root@linux-01sbin]#vi4.expect#!/usr/bin/expectsetpasswd"123456"spawnrsync-avroot@192.168.238.130:/tmp/12.txt/tmp/expect{"yes/no"{send"yes\r"}&quo
                            
                            
                                分类:
其他好文   时间:
2018-07-23 10:57:09   
                                阅读次数:
182
                             
                         
                    
                        
                            
                            
                                expect脚本同步文件在一台机器上把文件同步到多台机器上自动同步文件[root@akuilinux01sbin]#vim4.expect#!/usr/bin/expectsetpasswd"s5381561"spawnrsync-avroot@192.168.21.129:/tmp/12.txt/tmp/expect{"yes/no"{send"yes\r"}"password:"{send"$
                            
                            
                                分类:
其他好文   时间:
2018-07-23 00:07:27   
                                阅读次数:
211
                             
                         
                    
                        
                            
                            
                                20.31 expect脚本同步文件20.32 expect脚本指定host和要同步的文件20.33 构建文件分发系统20.34 批量远程执行命令20.31 expect脚本同步文件指定host和要同步的文件#!/usr/bin/expectset passwd "123456"set host [lindex $argv 0]set file [lindex $argv 1]
                            
                            
                                分类:
其他好文   时间:
2018-07-21 21:27:12   
                                阅读次数:
152
                             
                         
                    
                        
                            
                            
                                expect脚本同步文件自动同步文件#!/usr/bin/expectsetpasswd"123456"spawnrsync-avroot@192.168.133.132:/tmp/12.txt/tmp/expect{"yes/no"{send"yes\r"}"password:"{send"$passwd\r"}}expecteofexpect脚本指定host和要同步的文件指定host和要同步的
                            
                            
                                分类:
其他好文   时间:
2018-07-21 11:53:04   
                                阅读次数:
150
                             
                         
                    
                        
                            
                            
                                20.31 expect脚本同步文件expect脚本同步文件自动同步文件 : #!/usr/bin/expectset passwd "123456"spawn rsync -av root@192.168.133.132:/tmp/12.txt /tmp/ expect {"yes/no" { send "yes\r"
                            
                            
                                分类:
其他好文   时间:
2018-07-21 11:52:15   
                                阅读次数:
245
                             
                         
                    
                        
                            
                            
                                                         一、expect脚本同步文件自动同步文件 ,把远程的文件同步到本机cd /usr/local/sbi
                            
                            
                                分类:
其他好文   时间:
2018-06-08 12:17:13   
                                阅读次数:
193