Scripting for deleting logs

Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Scripting for deleting logs
# 1  
Old 09-18-2013
Computer Scripting for deleting logs

i wants to create the script for my linux server.

my system log files are getting huge frequently /root file system getting filled wants to delete the logs when it crossed 1GB data on it.

Please help me how do i create the bash script..

i use solaris 10 OS...
# 2  
Old 09-18-2013
create the script for my linux server.
i use solaris 10 OS...
# 3  
Old 09-18-2013
sorry it is linux server
# 4  
Old 09-18-2013
Why reinvent the wheel? You may want to look into logrotate. Not sure what flavor of Linux you're running, but it may already be installed. This site has some good tips on how to configure it.
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. Shell Programming and Scripting

Deleting 3 days old logs from a directory

As i am working in unix environment so i have an logs that is created by my application at the following location that is /opt/app/glac/current/servers/ops/logs inside the logs directory there are different kinds of logs(that is the file having extension as .log ) have been created... (1 Reply)
Discussion started by: 2015nks
1 Replies

3. Shell Programming and Scripting

Deleting specific lines from text file via scripting

Hi, I'm trying to search for some number and from that line, i need to delete the 5th line exactly. Eg: Consider below as text file data: 10000 a b c d e . . . 10000 w q t (8 Replies)
Discussion started by: Gautham
8 Replies

4. UNIX for Dummies Questions & Answers

Deleting a pattern in UNIX without deleting the entire line

Hi I have a file: r58778.3|SOURCES={KEY=f665931a...,fw,221-705}|ERRORS={16_1:T,30_1:T,56_1:C,57_1:T,59_1:A,101_1:A,115:-,158_1:C,186_1:A,204:-,271_1:T,305:-,350_1:C,368_1:G,442_1:C,472_1:G,477_1:A}|SOURCE_1="Contig_1092402550638"(f665931a359e36cea0976db191ff60ff09cc816e) I want to retain... (15 Replies)
Discussion started by: Alyaa
15 Replies

5. Web Development

Perl scripting or shell scripting?

i am going to study any one of the scripting languages mentioned above(shell 0r perl scripting) . Which is having more scope for a fresher? (1 Reply)
Discussion started by: Anna Hussie
1 Replies

6. Shell Programming and Scripting

Call Shell scripting from Perl Scripting.

Hi How to call a shell scripting through a Perl scripting? Actually I need some value from Shell scripting and passes in the Perl scripting. So how can i do this? (2 Replies)
Discussion started by: anupdas
2 Replies

7. Shell Programming and Scripting

Keeping only 6 logs and deleting the rest...

Hi Guys, I have folder where the logs are generated (which is quite a few). I want to keep the recent n logs and delete the rest of them.. I am able to sort them by using ls -t.. but how to take it forward.. Can you people help me.. Thanks for the help in advance, Regards,... (3 Replies)
Discussion started by: mac4rfree
3 Replies

8. Shell Programming and Scripting

Grep yesterday logs from weblogic logs

Hi, I am trying to write a script which would go search and get the info from the logs based on yesterday timestamp and write yesterday logs in new file. The log file format is as follows: """"""""""""""""""""""""""... (3 Replies)
Discussion started by: harish.parker
3 Replies

9. UNIX for Dummies Questions & Answers

Perl Scripting for monitoring logs

Hi, I am new to perl. I want to write a perl script to monitor logs. Where i want to monitor exceptions logged or any kind of error strings. I have a dir(On Solaris) with multiple log file which keeps rolling to .gz file after some time in that same dir. These logs files size keeps on... (1 Reply)
Discussion started by: solitare123
1 Replies

10. Shell Programming and Scripting

scripting guru's pls help me with scripting on AIX

can someone pls help me with the script for a files coming from one system to a particular directory and i want to write a script to move those files to another directory on different system by renaming the files... pls someone help me on this... thanking in anticipation.... (1 Reply)
Discussion started by: thatiprashant
1 Replies
Login or Register to Ask a Question

Featured Tech Videos