filesystem

Deletion of Files from File System

Submitted by Administrator on

Imagine a scenario where there is an automatically run job that deletes "old" files from a file system - for example financial data more than 5 years old.

This might be implemented with the following code:

find /data/finance -type f -mtime +1827 -exec /bin/rm '{}' \;

Up until 19-Jan-2038 03:14:07 UTC the code above will work as expected. After that time, behavior will depend on several factors as detailed below.

Find using time(), file system with 32-bit time fields