[X-Unix] Question about grep

Raoul Armfield armfield at amnh.org
Wed Mar 17 12:39:28 PST 2004


:On 3/17/04 12:18 PM, "Stroller" <MacMonster at myrealbox.com> wrote:
:
:> And having wasted all that time on an answer involving long date
:> formats, I think the answer is really a weekly `cron` job to
:>    mv Restrospect\ backup\ report Restrospect\ backup\ report-`date
:> +%Y-%m-%d_%X
:> and run your grep on the new one that's subsequently created 
:by the new
:> backup.
:
:Hmmm ... I don't think that will work.
:
:Retrospect's exported Backup Report will give me a bigger file 
:every day
:with everything going back for months and months, new things 
:not even added
:to the top! This is separate from the log. The log is display only and
:presented in a window - which I can truncate to an arbitary k limit,
:chopping off events too old mid-entry, will-nilly, which isn't 
:really my
:preference as I outlined in an earlier post. The Backup Report 
:in contrast
:just grows. It's also an optional thing to export and I've 
:never used it
:until now.
:
:So if I every day grep the file for that day's events, I will 
:in 7 days have
:created a file that goes back a week. And then the next day 
:will go back a
:week and a day. Etc, etc.
:
:To consistenly have a file that always has a week's worth of 
:events, I'll
:still need to at some point have some date-aware contruct 
:which can age out
:old events, not just lop off at a file size, and that brings 
:us back to the
:start of this thread.


I see what you are saying but what if you start on this mon for instance
by moving the one retrospect file to a different location.Then run a
cron job Sunday after your backup is complete that does cat logfile |
grep succesfull > successful_logfile.log and then mv
successful_logfile.log destination_folder

The syntax may not be perfect but that is the idea that I think was
behind what Stroller was trying to say




More information about the X-Unix mailing list