Ansible使用介绍

72课时
1.9K学过
8分

课程评价 (0)

请对课程作出评价:
0/300

学员评价

暂无精选评价
1分钟

16 Fetch模块

功能:从客户端取文件至服务器端,copy相反,目录可先tar

​ ansible srv -m fetch -a ‘src=/root/a.sh dest=/data/scripts’

示例:

打包/var/log下所有日志文件并远程抓取

​ ansible all -m shell -a ‘tar Jcf log.tar.xz /var/log/*.log’

​ ansible all -m fetch -a ‘src=/root/log.tar.xz dest=/data’