Forum Moderators: coopster

Message Too Old, No Replies

what is this set to?

         

laura2k

11:42 am on May 9, 2004 (gmt 0)



hi,

i have a code that deletes files that are certain days old, but i dont know exactly how old and i wanted to increase it to delete files that are 4 days old. Any suggestions would be great.

unlink $filename if $current - (stat $filename) [10] > 1 * 60 * 60 * 24;

Thanx

dcrombie

11:47 am on May 9, 2004 (gmt 0)



There's a Debian package called tmpreaper [packages.debian.org] that can do this automatically. The equivalent should exist for other platforms. Unless you actually need PHP to modify a database or something at the same time then this is your best option.

vincevincevince

11:57 am on May 9, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



1 * 60 * 60 * 24; = 1 x seconds x minutes x hours
e.g. 24 hours

if you want 4 days:

4*60*60*24