Hi there,

On 28 Jul 2009, at 13:41, PHPScriptor wrote:
Maybe a simple question, but I never did this before. How can I remove the old image-captcha's from my directory? How can this be done efficiently? Can this be done with Zend Framework? Or do I need to run a cronjob every
night? ...

The easiest way to do this is probably just via a shell script run via cron.

Assuming all image-captchas live in the same file (with nothing else) you can just do something like:

#! /bin/bash
cd /my/image/captcha/directory;
if (( $? == 0 )); then rm * ; fi

(The conditional just checks that the cd command worked -- otherwise you could be rm-ing all sorts of things.)

Hope that helps.

Regards,
Carlton


Reply via email to