Whamcloud - gitweb
LU-12027 utils: add units to "lfs find -amctime" 67/34367/5
authorAndreas Dilger <adilger@whamcloud.com>
Wed, 27 Feb 2019 09:25:23 +0000 (02:25 -0700)
committerOleg Drokin <green@whamcloud.com>
Sat, 13 Apr 2019 04:50:04 +0000 (04:50 +0000)
commit355c8a529a3a33a4db38e7d05bf558397a580657
treee9b8da197f137e61e5a2dddfa9b93f47838d6d7d
parenta8f4d1e5fd79e77f1347e983ec52f2ddc3e75ab9
LU-12027 utils: add units to "lfs find -amctime"

The normal find command can only specify time arguments in terms
of whole days. The MacOS find(1) man page reports the use of unit
suffixes to give better control over the time range, such as "1d4h".

Possible time units are as follows:

    s       second
    m       minute (60 seconds)
    h       hour (60 minutes)
    d       day (24 hours)
    w       week (7 days)
    y       year (365 days)

There is no "month" specifier here or in find(1), since the length
of a month is not fixed, and it would conflict with the 'm' minutes
unit.  Units may be combined in one argument, e.g. "-atime -1h30m".

For matches that are "equal" to the specified time, they must match
within the smallest unit specified.  For example, "-mtime 24h" would
match anything within 1h of 24h ago, similar to "-size 100M" will
match anything within 1MB of 100MB.

Test-Parameters: trivial fstype=zfs
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Ib1eb4e626b712bb75f13b075849f959f003ebbe5
Reviewed-on: https://review.whamcloud.com/34367
Reviewed-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Li Xi <lixi@ddn.com>
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/doc/lfs-find.1
lustre/include/lustre/lustreapi.h
lustre/tests/sanity.sh
lustre/utils/lfs.c
lustre/utils/liblustreapi.c