Sponsored Content
Top Forums Shell Programming and Scripting Delete log files automatically. Post 302658545 by lennyz04 on Tuesday 19th of June 2012 12:19:51 PM
Old 06-19-2012
Is there a better script to accomplish what I am trying to do.

I am trying to delete files out of the log directory automatically every 120 days.

The reason for this is because if they are not deleted then we will get a warning letting us know that capacity is a 99%

Help would be very appreciated on this topic.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to delete log files

Hi, I want to delete the old log files in the logs directory. I want to keep logs for a week.What comamnd should i use? Log file name is prcsstop_121105.log Many Thanks, (2 Replies)
Discussion started by: castlerock
2 Replies

2. Shell Programming and Scripting

How to set delete Key to erase automatically

We need to su to root in 1000 systems, so it is almost impossible to add "stty erase ^H" to every .profile on these systems. Is there any way to set delete key to erase automatically after running "su -"? Thanks :) (4 Replies)
Discussion started by: aixlover
4 Replies

3. Shell Programming and Scripting

How to automatically delete old backups

I'm creating nightly backups using cygwin bash with this one line script: zip -r "K:/backup/outlook/`date "+%y%m%d%M"`" C:/Documents\ and\ Settings/siegfried/Local\ Settings/Application\ Data/Microsoft/Outlook How can I enhance my script using the "rm" command so I never have more than 4 zip... (2 Replies)
Discussion started by: siegfried
2 Replies

4. UNIX for Advanced & Expert Users

What is the best way to delete log files?

As per my knowledge we need to take back up of a log file before clearing the log file then needs to perform this like this: ">logfile". Please correct me if I am wrong. And add your comments if any. Also I want to understand how will ">" this help in clearing the log file. Whats wrong if we... (6 Replies)
Discussion started by: praveen_b744
6 Replies

5. Shell Programming and Scripting

Delete log files content older than 30 days and append the lastest date log file date

To delete log files content older than 30 days and append the lastest date log file date in the respective logs I want to write a shell script that deletes all log files content older than 30 days and append the lastest log file date in the respective logs This is my script cd... (2 Replies)
Discussion started by: sreekumarhari
2 Replies

6. How to Post in the The UNIX and Linux Forums

Very Urgent ---Need to delete the log files when the disk used% greater than 85% using df -k*

Hi, I am new to Shell scripts. I have an urgent requirement to find the disk space using "df -k". from that output,I need to check the used% whether greater than 85%. if it is greater than 85% then need to delete my log files. It is very urgent please some one help me. Thanks in Advance... (1 Reply)
Discussion started by: Anandbarnabas
1 Replies

7. Shell Programming and Scripting

Need to delete the log files when the disk used% greater than 85% using df -k

Hi, I am new to Shell scripts. I have an urgent requirement to find the disk space using "df -k". from that output,I need to check the used% whether greater than 85%. if it is greater than 85% then need to delete my log files. It is very urgent please some one help me. Thanks in Advance... (2 Replies)
Discussion started by: Anandbarnabas
2 Replies

8. Shell Programming and Scripting

Delete all files from the directory except the ones in the log file

I have a log file with contents like below. Repository: https://someserver:9443/ Workspace: (1000) "test_scripts_ws" Component: (1001) "some_Automated_Scripts" Change sets: (1002) ---$ john "test memory" 17-Sep-2014 02:24 PM Changes: --a--... (9 Replies)
Discussion started by: gaurav99
9 Replies

9. UNIX for Advanced & Expert Users

Help with a shell script? List files, delete them and log them

Hello, i'm trying to solve this script. List, one at a time, all files larger than 100K in the /home/username directory tree. Give the user the option to delete or compress the file, then proceed to show the next one. Write to a logfile the names of all deleted files and the deletion times. I... (7 Replies)
Discussion started by: jose2802
7 Replies

10. Linux

Can we delete /var/log/messages-2015* files

Hi Team, My linux version is Linux 2.6.32-71.el6.x86_64 #1 SMP Wed Sep 1 01:33:01 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux Now /var mount point is full, and I don't know what files to delete from this file system. When I checked /var/log there are lot of log files starting with name... (3 Replies)
Discussion started by: Bhavi
3 Replies
SENDINPATHS(8)						    InterNetNews Documentation						    SENDINPATHS(8)

NAME
sendinpaths - Send Usenet Path: statistics via e-mail SYNOPSIS
sendinpaths [-cdhn] [-k keep-days] [-r report-days] [address [address ...]] DESCRIPTION
sendinpaths checks pathlog/path for ninpaths dump files, finds dump files generated in the past report-days days, makes sure they are valid by running ninpaths on each one and making sure the exit status is zero, and passes them to ninpaths to generate a cumulative report. By default, that report is mailed to the e-mail addresses configured at the beginning of this script (by default, only one address is configured: <top1000@anthologeek.net>) in order to supply the TOP1000 project with useful statistics. See <http://top1000.anthologeek.net/> for more information. When finished, sendinpaths deletes all dump files in pathlog/path that are older than keep-days days. For more information on how to set up ninpaths, see ninpaths(8). OPTIONS
-c When this flag is used, the report is also e-mailed, besides the default submission addresses or those given as command-line arguments, to the newsmaster's address set at configure time. -d Enables debug messages. -h Gives usage information. -k keep-days After having processed dump files, sendinpaths removes those that are older than keep-days days. The default is 0, that is to say to remove all dump files. Setting keep-days to another value can be useful for debugging purpose because it permits to keep a few dump files. -n Don't e-mail the report; instead, just print it to standard output. Don't delete old dump files. -r report-days Process dump files generated during the last report-days days. The default is 32, that is to say to process all the dump files that have been generated during the last 32 days (if, of course, they have not been deleted yet by a previous run of sendinpaths according to the value set by the -k flag). address ... E-mail the report to the mentioned address or addresses, instead of the default one. Several addresses can be used, separated by whitespace. For instance, for two adresses: sendinpaths pathsurvey@top1000.org top1000@anthologeek.net HISTORY
sendinpaths was written by Olaf Titz <olaf@bigred.inka.de>. $Id: sendinpaths.pod 9384 2011-12-25 20:57:03Z iulius $ SEE ALSO
ninpaths(8). INN 2.5.3 2012-06-15 SENDINPATHS(8)
All times are GMT -4. The time now is 09:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy