RE: [PHP] Deleting a file after download/upload
| From: | Daevid Vincent | Date: | Tue, 23 Jun 2009 18:57:50 +0000 |
| Subject: | RE: [PHP] Deleting a file after download/upload | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-294471@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Parham Doustdar [mailto:parham90@gmail.com]
> Sent: Tuesday, June 23, 2009 12:33 PM
> To: php-general@lists.php.net
> Subject: [PHP] Deleting a file after download/upload
>
> My server connects to an FTP. Then, it downloads a file from
> the FTP, and then sends me the link to that temperary file on
> the server. Now, when I download it from my server, my script
> should delete the file. How can I make it wait until the
> download of the file is finished?
# sudo crontab -e
Append this to the end...
15 * * * * root find /tmp/downloads -mtime +5 -type f -exec rm -rf {} \;
That will run every 15 minutes and purge anything in /tmp/downloads that is
over 5 days old