LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-27-2009, 10:39 AM   #1
paeon
LQ Newbie
 
Registered: Nov 2009
Posts: 3

Rep: Reputation: 0
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
 
Old 11-27-2009, 11:04 AM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Hi, welcome to LQ!

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



Cheers,
Tink
 
Old 11-27-2009, 11:16 AM   #3
paeon
LQ Newbie
 
Registered: Nov 2009
Posts: 3

Original Poster
Rep: Reputation: 0
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
 
Old 11-27-2009, 11:34 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
edit roots cron-tab.
Code:
*/2 * * * *  find /usr/local/red5/webapps/videorecorder/streams/_definst_/ -type f -cmin +120 -name \*flv -exec rm
 
Old 11-28-2009, 12:19 AM   #5
paeon
LQ Newbie
 
Registered: Nov 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Many many thanks Tink,

you are brilliant, just had to add {} \; to the end of the
command and it worked
 
Old 11-28-2009, 12:30 AM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash, deleting only files in a directory tree? jon_k Programming 4 05-13-2007 11:36 AM
script for deleting .dat files which > 5 mb from a directory and its subdirectory anindyabhattacharjee Linux - Enterprise 2 01-15-2007 11:38 PM
Changing File Permission in a FTP directory to prevent deleting of files shawnbishop Linux - Software 3 01-10-2006 05:41 AM
Deleting unwanted files from any directory without reading each Karthikeyan Gurusamy Linux - Newbie 3 12-24-2005 01:48 AM
deleting all *.m3u files in a directory+subdir? minm Linux - Newbie 5 10-12-2004 03:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration