- 论坛徽章:
- 14
|
本帖最后由 reb00t 于 2015-06-25 14:37 编辑
哇靠,这年头还用expect out了,直接上ansible吧
丰富的模块随便玩。- ansible 127.0.0.1 -m synchronize -a 'src=/tmp/haha/ dest=/tmp/hehe/ mode=push delete=yes rsync_path=/usr/bin/rsync rsync_opts="-avz,--exclude=.git/"' -k
- SSH password:
- 127.0.0.1 | success >> {
- "changed": true,
- "cmd": "rsync --delay-updates -F --compress --delete-after --archive --rsh 'ssh -S none -o StrictHostKeyChecking=no' --rsync-path=\"/usr/bin/rsync\" -avz --exclude=.git/ --out-format='<<CHANGED>>%i %n%L' \"/tmp/haha/\" \"/tmp/hehe/\""
- "sent 5572 bytes received 293 bytes 11730.00 bytes/sec",
- "total size is 9139 speedup is 1.56"
复制代码 @reyleon |
|