Whamcloud - gitweb
LU-12984 utils: Add -newerXY support for lfs find 06/36806/9
authorQian Yingjin <qian@ddn.com>
Wed, 20 Nov 2019 15:12:10 +0000 (23:12 +0800)
committerOleg Drokin <green@whamcloud.com>
Mon, 16 Dec 2019 05:58:27 +0000 (05:58 +0000)
commit8583479b1249fa154cb0944f9a3aed43c2e549ce
treeac302f1f8ed1bf0018b4865ec55918a285d46374
parent037840fb6b86d6083d55f3da5ad70d19d34cc5a5
LU-12984 utils: Add -newerXY support for lfs find

In regular "find" it is possible to specify a filename to use
for a relative timestamp:
-newerXY reference
 Compares the timestamp of the current file with reference.
 The reference argument is normally the name of a file (and
 one of its timestamps is used for the comparison) but it may
 also be a string describing an absolute time. X and Y are
 placeholders for other letters, and these letters select which
 time belonging to how reference is used for the comparison.
 - a   The access time of the file reference
 - c   The inode status change time of reference
 - m   The modification time of the file reference
 - t   reference is interpreted directly as a time

We should enhance Lustre 'lfs find' to support '-newerXY' options.
In current implementation, When reference is interpreted directly
as a time, it must be in one of the following formats:
- "%Y-%m-%d %H:%M:%S"
- "%Y-%m-%d %H:%M"
- "%Y-%m-%d"
- "%H:%M:%S"
- "%H:%M"
- "@%s"
- "%s"
Otherwise, it will report errors.

Signed-off-by: Qian Yingjin <qian@ddn.com>
Change-Id: Ib006940b231c4a18f892c492dd892f7733b5d8ba
Reviewed-on: https://review.whamcloud.com/36806
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Li Xi <lixi@ddn.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/doc/lfs-find.1
lustre/include/lustre/lustreapi.h
lustre/tests/sanity.sh
lustre/utils/lfs.c
lustre/utils/liblustreapi.c