expect脚本同步文件自动同步文件#!/usr/bin/expectsetpasswd"目标机器密码"spawnrsync-avroot@目标机器ip:/tmp/12.txt/tmp/expect{"yes/no"{send"yes\r"}"password:"{send"$passwd\r"}}
                            
                            
                                分类:
其他好文   时间:
2018-06-08 00:42:56   
                                阅读次数:
158
                             
                    
                        
                            
                            
                                20.31 expect脚本同步文件;20.32 expect脚本指定host和要同步的文件;20.33 构建文件分发系统;20.34 批量远程执行命令20.31 expect脚本同步文件自动同步文件1. 同步远程机器hao2上/tmp/12.txt文件 到本机/tmp/下 :[root@hao-01 ~]# vim 4.expect添加内容:#!/usr/bin/expectset passwd
                            
                            
                                分类:
其他好文   时间:
2018-05-03 14:22:20   
                                阅读次数:
151
                             
                    
                        
                            
                            
                                [toc]五、自动同步文件5.1配置脚本核心命令,就是用的rsync服务。[root@xavilinux03sbin]#vim4.expect#!/usr/bin/expectsetpasswd"123456"spawnrsync-avroot@192.168.XXX.XXX:/tmp/12.txt/tmp/expect{"yes/no"{send"yes\r"}"password:"{send"
                            
                            
                                分类:
系统相关   时间:
2018-05-01 12:39:47   
                                阅读次数:
219
                             
                    
                        
                            
                            
                                    自动同步文件 指定host和要同步的文件 需求背景对于大公司而言,肯定时不时会有网站或者配置文件更新,而且使用的机器肯定也是好多台,少则几台,多则几十甚至上百台。所以,自动同步文件是至关重要的。 实现思路首先要有一台模板机器,把要分发的文件准备好,然后只要使用expect脚本批量把需要同步的文件分发 ...
                            
                            
                                分类:
其他好文   时间:
2018-04-30 00:03:07   
                                阅读次数:
196
                             
                    
                        
                            
                            
                                expect脚本自动同步文件#!/usr/bin/expectsetpasswd"1q2w3e"spawnrsync-avroot@192.168.67.129:/tmp/12.txt/tmp/expect{"yes/no"{send"yes\r"}"password:"{send"$passwd\r&quo
                            
                            
                                分类:
其他好文   时间:
2018-04-27 02:23:54   
                                阅读次数:
149
                             
                    
                        
                            
                            
                                20.31expect脚本同步文件#!/usr/bin/expectsetpasswd"liang.123"spawnrsync-avroot@192.168.137.130:/tmp/12.txt/tmp/将远程的/tmp/12.txt同步到本地的机器上expect{"yes/no"{send"yes\r"}第一次会提示yes或no&q
                            
                            
                                分类:
其他好文   时间:
2018-04-26 23:39:30   
                                阅读次数:
329
                             
                    
                        
                            
                            
                                十八周二次课(4月26日)20.31 expect脚本同步文件20.32 expect脚本指定host和要同步的文件20.33 构建文件分发系统20.34 批量远程执行命令20.31 expect脚本同步文件自动同步文件 编辑脚本文件:vi 4.expect#!/usr/bin/expectset passwd "123456"spawn rsync -av root@192.
                            
                            
                                分类:
其他好文   时间:
2018-04-26 17:00:32   
                                阅读次数:
205
                             
                    
                        
                            
                            
                                20.31 expect脚本同步文件
20.32 expect脚本指定host和要同步的文件
20.33 构建文件分发系统
20.34 批量远程执行命令
                            
                            
                                分类:
其他好文   时间:
2018-04-26 01:08:21   
                                阅读次数:
161
                             
                    
                        
                            
                            
                                批量远程执行命令在一台机器上远程到多台机器上执行多条命令,怎么实现呢?写一个登录到多台机器并执行命令的脚本文件remote-exec-command.sh#!/usr/bin/expectsethost[lindex$argv0]setcommand[lindex$argv1]setuser"root"setpasswd"root"spawnssh$user@$hostexpect{"yes/no
                            
                            
                                分类:
其他好文   时间:
2018-03-18 17:45:16   
                                阅读次数:
159
                             
                    
                        
                            
                            
                                expect脚本同步文件[root@centos7-3shell]#vi1.expect#!/usr/bin/expectsetpasswd"123456"spawnrsync-avroot@192.168.1.83:/tmp/12.txt/tmp/expect{"yes/no"{send"yes\r"}"password:"{send"$passwd\r"}}expecteof[root@cen
                            
                            
                                分类:
其他好文   时间:
2018-03-01 11:46:17   
                                阅读次数:
126