LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Deleting files from Red5 streams directory (https://www.linuxquestions.org/questions/linux-newbie-8/deleting-files-from-red5-streams-directory-771936/)

paeon 11-27-2009 10:39 AM

Deleting files from Red5 streams directory
 
Hi Everyone

I have Red5 installed and running OK, also have a
flash video recorder that writes flv files to a streams
directory /usr/local/red5/webapps/videorecorder/streams/_definst_/

This all works fine, the files are being recorded as::

-rw-r--r-- 1 root root 541007 Nov 25 19:29 videoStream_1259177350453_25.flv

My question is, how do I delete these files from
either a php script, or shell script via a cron job?

I know it has to do with who owns the files, and
chmods etc, but am a bit lost as to how.

any help greatly appeciated

Tony

Tinkster 11-27-2009 11:04 AM

Hi, welcome to LQ!

Any criteria, like age? Do you have root access?



Cheers,
Tink

paeon 11-27-2009 11:16 AM

Hi Tink

I will need to delete all files older that say 2 hours,
just to make sure that no one is recording files at the
time the cron is set to delete.

I have root access and can delete these files
manually, but I need to automate the process.

thanks

Tony

Tinkster 11-27-2009 11:34 PM

edit roots cron-tab.
Code:

*/2 * * * *  find /usr/local/red5/webapps/videorecorder/streams/_definst_/ -type f -cmin +120 -name \*flv -exec rm

paeon 11-28-2009 12:19 AM

Many many thanks Tink,

you are brilliant, just had to add {} \; to the end of the
command and it worked:)

Tinkster 11-28-2009 12:30 AM

Ooops ... my apologies. Must be the pain (and the painkillers ;}) fogging my
judgement of what I type.


All times are GMT -5. The time now is 04:14 AM.