LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-12-2009, 09:32 AM   #1
johnh10000
Member
 
Registered: Nov 2008
Distribution: Ubuntu Lucid Lynx
Posts: 541

Rep: Reputation: 33
err linux find


I am not really sure what I need here. I have motion running now (webcam) which taks a pic every 6 mins.

So I am thinking after every hour delete the previous hour's jpgs.

I need the lastsnap.jpg (symlink) and what it points to. Everything else can be deleted.

Not sure where to start.
 
Old 12-12-2009, 01:42 PM   #2
Vookimedlo
Member
 
Registered: Jul 2004
Location: Czech Republic - Roudnice nad Labem
Distribution: Debian
Posts: 253

Rep: Reputation: 34
Hi,

What about following:

Code:
find . ! -mmin -60 -type f -name "*.jpg" -print0 | xargs -0 rm -f
It deletes all jpegs older than 60 minutes (mmin argument) while preserving symbolic link. This is safe with knowledge that symlink points to last image generated every 6 minutes.




V.
 
  


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
To err or not to err? Filesystem Error Problem abejarano Linux - Hardware 3 12-09-2008 05:12 PM
core dump on linux with err variable dayalan_cse Programming 5 06-03-2008 08:09 AM
Dual system boot err: rootnoverify(hd1,0),but the hd0 err msg existed befor shut down lilipeng24 Linux - General 3 06-25-2005 01:10 PM
err=2 noz6 Slackware - Installation 3 01-31-2005 12:26 AM
linux server very slow about top output and mysqld.err csstudy Linux - General 2 08-10-2004 03:04 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:37 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration