capulet_x

msg:3329465 | 5:09 am on May 3, 2007 (gmt 0) |
Oh, I forgot to mention, that I need to extract the time and file name so that I can identify which files to delete. This might f already been obvious but no harm in clarifying.
|
jatar_k

msg:3329677 | 11:48 am on May 3, 2007 (gmt 0) |
can you use the directory class? [php.net...]
|
Ninjabear

msg:3329882 | 3:48 pm on May 3, 2007 (gmt 0) |
Could you not just check the file creating time using fstat or similar function and then just use unlink to delete the file? [uk2.php.net...]
|
adb64

msg:3332417 | 9:13 pm on May 6, 2007 (gmt 0) |
Does your host allows you to use the FTP functions [php.net] of PHP? You then may use these to FTP to your server and delete the files using ftp_delete [php.net]. FTP also provides functions for reading, creating and deleting directories.
|
capulet_x

msg:3332579 | 1:22 am on May 7, 2007 (gmt 0) |
I looked into all of the suggestions submitted here and each has its own merit, however, it seems that my biggest hurdle is that I won't necessarily know the names of these files to target them. I only know where they will be. Also I can't delete all of the files at once only those that are more than 24 hours old. That's why I thought in lieu of the functions not available to me because of shared server constraints (noted at the beginning of this post) I thought I could create a script to parse the information I needed from my detailed log files to identify specific files that met the criteria for deletion. I didn't glean that I could do this with the examples suggested. If I am wrong could someone elaborate on how I would apply the presented options?
|
adb64

msg:3332779 | 8:05 am on May 7, 2007 (gmt 0) |
If I understand your posts correctly you have a log file in the format described in your first post. Is this format fixed or can you change the script that writes this logfile so it writes one entry per line in a format that can be parsed easily by another script like e.g.:
2007/05/02 2:00:31 http://www.example.com/myFile.zip someone@example.com 2007/05/02 2:08:31 http://www.example.com/myPic.jpg someone2@anotherexample.com
Is this possible? If not we have to make a more complex parser to parse the logfile in the format you described.
|
|