Remove logs by date


 
Thread Tools Search this Thread
Operating Systems Solaris Remove logs by date
# 1  
Old 05-30-2008
Remove logs by date

Hi

I Need To Remove Logs Older Than April 1 St(4/1/2007) By Date

I Have A Script To Remove 3 Months Old Like Using 90 Days

Thanks
# 2  
Old 05-30-2008
Provide a sample file we can work on please.
# 3  
Old 05-30-2008
like

xxxxx.log.20070509125745
xxxxx.log.20070103113245
xxxxx.log.20070314105745
xxxxx.log.20070219215715
xxxxx.log.20070429162035
# 4  
Old 05-31-2008
With awk:

Code:
awk -F"." '$3 > 20070401000000' file

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

If I ran perl script again,old logs should move with today date and new logs should generate.

Appreciate help for the below issue. Im using below code.....I dont want to attach the logs when I ran the perl twice...I just want to take backup with today date and generate new logs...What I need to do for the below scirpt.............. 1)if logs exist it should move the logs with extention... (1 Reply)
Discussion started by: Sanjeev G
1 Replies

2. Solaris

How to print the particular date logs on UNIX (Solaris)?

I would like to get only some particular date logs from /var/adm/messages. Please suggest any command or script to get this. (3 Replies)
Discussion started by: seenuvasan1985
3 Replies

3. Shell Programming and Scripting

Grep a pattern in current date logs

Hello, I need to write one script which should search particular pattern like ABCD in log file name hello.txt only in current date logs. in current directory i have so many past date logs but grep should be applied on current date logs. on daily basis current date logs are in number 30 and... (2 Replies)
Discussion started by: ajju
2 Replies

4. UNIX for Dummies Questions & Answers

Removing the logs of previous date

Hi folks, Please advise there is directory named logs and which there are several logs are there with the name appended by date , I can take out the latest one through cd /var/log ls -ltr but please suggest the command through which I can remove the logs of all the previous dats , the... (2 Replies)
Discussion started by: SankalpS
2 Replies

5. Shell Programming and Scripting

How to remove the logs more than 5 days old

All, How to remove the logs that are more than 5 days old from a particular folder. Help will be highly appreciated. Regards Oracle User (2 Replies)
Discussion started by: Oracle_User
2 Replies

6. Shell Programming and Scripting

Lots of logs to move....don't remove if open

I have a ksh script that currently moves a day's worth of log files (about 15,000) files to a different directory. The issue is that about 100 of these files are still open for write when this happens. I need an efficient way to ensure that these files aren't open without doing an lsof on each... (7 Replies)
Discussion started by: nestafaria
7 Replies

7. Shell Programming and Scripting

How to find the password in the logs and remove the log which indicate it.

I want to crypt my files but as you know I have to write the password in the xterm...as you know there is a log where every thing I write in the xterm are store on it..how can I get the logs and delete the record which indicate my password..or prevent the xterm from storing my password in the... (2 Replies)
Discussion started by: ahmad.diab
2 Replies

8. Shell Programming and Scripting

Get Data Between a specific Date Range from logs

I need to extract data from logs for a mentioned date range..Its quite urgent can anyone help me out with it..its to be written in unix..just thought its better to specify.. (4 Replies)
Discussion started by: sankasu
4 Replies

9. Shell Programming and Scripting

not able to redirect the logs of a singl date in one system

Hi All, I have around 15 servers. I need to check for the error in /var/adm/messages in 15 servers of current date everyday and log it in one server. rsh is configured in all servers. The command I am using to accomplish this in shell script is rsh <remote sever> grep 'Jun 17'... (2 Replies)
Discussion started by: partha_bhunia
2 Replies

10. Shell Programming and Scripting

Remove out date logs

hi all, i would like to write the shell script to remove the out-dated log my log file name will be like this: access_20050101.log access_20050102.log . . . access_20071007.log access_20071008.log access_20071009.log i has try to write the command as following, it will be remove the... (2 Replies)
Discussion started by: eric_wong_ch
2 Replies
Login or Register to Ask a Question