有 300 多台服务器,每台 /tmp/log/目录下都有个文件,名字为 本机 ip.txt 如 192.168.1.1.txt 、192.168.1.2.txt ... 如何批量下载回本机?
以下亲测无效
ansible all -m fetch -a "src=http://www.v2ex.com/tmp/log/* dest=/tmp/"
1 tusj 2018-01-16 15:03:16 +08:00 单引号试试 双引号的话本地 shell 会展开里面的东西 |
2 jejer 2018-01-16 16:26:42 +08:00 用 rsync 吧 |
![]() | 3 hljjhb 2018-01-16 17:27:46 +08:00 |
![]() | 4 hljjhb 2018-01-16 18:02:18 +08:00 突然反应过来是问如何解决 - - ansible all -m synchronize -a "src=http://www.v2ex.com/tmp/log dest=/tmp/{{inventory_hostname}}/ mode=pull" |