linux文件确定改动时间的实践

使用到stat命令,如 stat /etc/hosts

ansible批量执行 stat /etc/hosts

修改前==========================================================
10.10.74.4 | success | rc=0 >>
#stat /etc/hosts
File: `/etc/hosts’
Size: 158 Blocks: 8 IO Block: 4096 regular file
Device: fd00h/64768d Inode: 46 Links: 1
Access: (0644/-rw-r–r–) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2017-07-24 10:34:08.157207600 +0800
Modify: 2010-01-12 21:28:22.000000000 +0800
Change: 2016-11-21 10:20:18.207453325 +0800

10.10.140.4 | success | rc=0 >>
#stat /etc/hosts
File: `/etc/hosts’
Size: 158 Blocks: 8 IO Block: 4096 regular file
Device: fd00h/64768d Inode: 46 Links: 1
Access: (0644/-rw-r–r–) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2017-07-24 10:25:01.163503316 +0800
Modify: 2010-01-12 21:28:22.000000000 +0800
Change: 2016-11-21 10:20:17.653603720 +0800

10.10.74.5 | success | rc=0 >>
#stat /etc/hosts
File: `/etc/hosts’
Size: 158 Blocks: 8 IO Block: 4096 regular file
Device: fd00h/64768d Inode: 46 Links: 1
Access: (0644/-rw-r–r–) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2017-07-24 10:44:32.810753357 +0800
Modify: 2010-01-12 21:28:22.000000000 +0800
Change: 2016-11-21 10:20:18.384762182 +0800

10.10.140.5 | success | rc=0 >>
#stat /etc/hosts
File: `/etc/hosts’
Size: 158 Blocks: 8 IO Block: 4096 regular file
Device: fd00h/64768d Inode: 46 Links: 1
Access: (0644/-rw-r–r–) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2017-07-24 10:30:01.654662528 +0800
Modify: 2010-01-12 21:28:22.000000000 +0800
Change: 2016-11-21 10:20:17.769549699 +0800

修改后==========================================================
10.10.74.4 | success | rc=0 >>
#stat /etc/hosts
File: `/etc/hosts’
Size: 291 Blocks: 8 IO Block: 4096 regular file
Device: fd00h/64768d Inode: 46 Links: 1
Access: (0644/-rw-r–r–) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2017-07-24 16:03:01.312890255 +0800
Modify: 2017-07-24 16:02:08.354424270 +0800
Change: 2017-07-24 16:02:08.368431298 +0800

10.10.140.5 | success | rc=0 >>
#stat /etc/hosts
File: `/etc/hosts’
Size: 291 Blocks: 8 IO Block: 4096 regular file
Device: fd00h/64768d Inode: 46 Links: 1
Access: (0644/-rw-r–r–) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2017-07-24 16:04:01.114039304 +0800
Modify: 2017-07-24 16:03:28.523752384 +0800
Change: 2017-07-24 16:03:28.532756795 +0800

10.10.140.4 | success | rc=0 >>
#stat /etc/hosts
File: `/etc/hosts’
Size: 291 Blocks: 8 IO Block: 4096 regular file
Device: fd00h/64768d Inode: 46 Links: 1
Access: (0644/-rw-r–r–) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2017-07-24 16:03:01.723764534 +0800
Modify: 2017-07-24 16:02:43.820817251 +0800
Change: 2017-07-24 16:02:43.842828585 +0800

10.10.74.5 | success | rc=0 >>
#stat /etc/hosts
File: `/etc/hosts’
Size: 291 Blocks: 8 IO Block: 4096 regular file
Device: fd00h/64768d Inode: 46 Links: 1
Access: (0644/-rw-r–r–) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2017-07-24 16:03:01.830386858 +0800
Modify: 2017-07-24 16:02:31.054006378 +0800
Change: 2017-07-24 16:02:31.059008878 +0800

发布日期:
分类:Linux-Unix