ansible 统计检查最后修改时间
ansible stat check last modified time
我有一种情况需要使用 ansible 检查文件的最后修改日期。通常 linux 中的 stat 具有文件的属性,如修改、访问和更改。我知道 p.stat.isdir 和 p.stat.pw_name 存在但是我们是否有类似的选项使用 ansible stat 检查文件的最后修改日期?
ansible 有同名模块 stat
http://docs.ansible.com/ansible/stat_module.html
它的 return 值包含 mtime
,这正是您正在寻找的。
mtime
Time of last modification
success, path exists and user can read stats
我有一种情况需要使用 ansible 检查文件的最后修改日期。通常 linux 中的 stat 具有文件的属性,如修改、访问和更改。我知道 p.stat.isdir 和 p.stat.pw_name 存在但是我们是否有类似的选项使用 ansible stat 检查文件的最后修改日期?
ansible 有同名模块 stat
http://docs.ansible.com/ansible/stat_module.html
它的 return 值包含 mtime
,这正是您正在寻找的。
mtime
Time of last modification
success, path exists and user can read stats