How to clean up files that were created some time ago.

find $AN_ABSOLUTE_FOLDER_PATH -mtime +$DAYS_TO_EXPIRE -type f -exec rm -f {} \

you can also use command to change existing file time to test the above command

touch -d "2015-11-28 02:24:01" [filename]           

touch -m -d "2015-11-28 02:24:01" [filename]

touch -a -d "2015-11-28 02:24:01" [filename]

"-m" means only change the modified time, "-a" means only change the access time. 

posted on 2015-11-28 14:27  windrainer  阅读(128)  评论(0)    收藏  举报

导航