The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
help me in sending parameters from sqlplus script to unix shell script Hara Shell Programming and Scripting 2 01-29-2008 03:31 PM
Shell Script: want to insert values in database when update script runs ring Shell Programming and Scripting 1 10-25-2007 03:06 AM
here document to automate perl script that call script hogger84 Shell Programming and Scripting 3 10-22-2007 10:15 AM
returning to the parent shell after invoking a script within a script gurukottur Shell Programming and Scripting 5 09-26-2006 07:05 AM
return valuse from child script to parent script borncrazy Shell Programming and Scripting 1 08-20-2004 03:39 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 07-03-2003
abhi123 abhi123 is offline
Registered User
  
 

Join Date: May 2003
Posts: 13
help in sed script

I am having a shell script that connects to database half hourly and pulls out the backlog from some tables. Now that logfile is growing too big and I need to housekeep it! effectively I want to keep last 30 days data in that file and move rest to archived file.
The file contents are as below.
the algorithm I want is as follow :

take input file my.log
go to first line, check if this is more than 90 days
if it is then
pick those lines fom log file till the next sql plus ( i.e. that block) and append to some archive file ( difficult ?)
delete these lines from current file

if it is not then leave it as it is

can somebody help me writting this please ?

---------------------------------------------------------------------------------SQL*Plus: Release 8.1.7.0.0 - Production on Thu Feb 27 19:20:00 2003

(c) Copyright 2000 Oracle Corporation. All rights reserved.

Enter user-name:
Connected to:
Oracle8i Enterprise Edition Release 8.1.7.4.0 - 64bit Production
With the Partitioning option
JServer Release 8.1.7.4.0 - 64bit Production

SQL> SQL> 76834445

SQL> 76834445

SQL> 2 3 4 5 6 7 8 9 ELFORDE
75241084 1593361 25-NOV-02 18:18:10

HEWITTSA
76238384 596061 20-DEC-02 09:18:09
SQL> Disconnected from Oracle8i Enterprise Edition Release 8.1.7.4.0 - 64bit Pro
duction
With the Partitioning option
JServer Release 8.1.7.4.0 - 64bit Production

SQL*Plus: Release 8.1.7.0.0 - Production on Thu Feb 27 19:50:00 2003

(c) Copyright 2000 Oracle Corporation. All rights reserved.

Enter user-name:
Connected to:
Oracle8i Enterprise Edition Release 8.1.7.4.0 - 64bit Production
With the Partitioning option
JServer Release 8.1.7.4.0 - 64bit Production
---------------------------------------------------------------------------------

Thanks in advance.
 

Bookmarks

Tags
awk, awk trim, solaris, trim, trim awk

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:27 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0