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