bash 스크립트 find
으로 폴더와 파일의 최종 수정 시간을 확인할 수 있습니다. 다음은 몇 가지 PHP의 예는 다음과 같습니다
exec('find . -mtime -1 -type d', $output);
// $output: list of folders modified within 24 hours
unset($output);
exec('find . -mtime -1 -type f', $output);
// $output: list of files modified within 24 hours
unset($output);
exec('find . -mtime +0 -type f', $output);
// $output: list of files modified greater than 24 hours
unset($output);
당신은 -amin
, -atime
, -cmin
, -ctime
, -mmin
및 -mtime
도 이러한 옵션을 확인해야합니다.
-amin n
File was last accessed n minutes ago.
-atime n
File was last accessed n*24 hours ago. When find figures out
how many 24-hour periods ago the file was last accessed, any
fractional part is ignored, so to match -atime +1, a file has
to have been accessed at least two days ago.
-cmin n
File's status was last changed n minutes ago.
-ctime n
File's status was last changed n*24 hours ago. See the
comments for -atime to understand how rounding affects the
interpretation of file status change times.
-mmin n
File's data was last modified n minutes ago.
-mtime n
File's data was last modified n*24 hours ago. See the
comments for -atime to understand how rounding affects the
interpretation of file modification times.
출처
2017-12-16 12:30:37
Ben
올바른 경로에있는 것 같습니다. 프로세스의 마지막 수정 날짜 사용을 고려하십시오. –
안녕하세요. 우리에게 보여줄 코드가 있습니까? [최소한의 완전하고 검증 가능한 예제를 만드는 방법] (https://stackoverflow.com/help/mcve)을 읽어보십시오. – Michel