Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 12-12-2009, 08:32 AM   #1
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, 12:42 PM   #2
Registered: Jul 2004
Location: Czech Republic - Roudnice nad Labem
Distribution: Debian
Posts: 253

Rep: Reputation: 34

What about following:

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.



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 04:12 PM
core dump on linux with err variable dayalan_cse Programming 5 06-03-2008 07: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 12:10 PM
err=2 noz6 Slackware - Installation 3 01-30-2005 11:26 PM
linux server very slow about top output and mysqld.err csstudy Linux - General 2 08-10-2004 02:04 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:29 AM.

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