Sponsored Content
Special Forums Hardware Filesystems, Disks and Memory Delete file by date or by size Post 17412 by Cameron on Thursday 14th of March 2002 06:00:54 PM
Old 03-14-2002
One suggestion may be that every 10 days that you swap files.
Hence you'd have two files at anyone time providing 20 days of log details (~/LogFile-A & ~/LogFile-B). Every 10 days swap between the two...for instance.

1/ Currently on LogFile-A
2/ 10 Days later swap to LogFile-B
3/ 10 Days later empty LogFile-A and swap to LogFile-A
4/ 10 Days later empty LogFile-B and swap to LogFile-B
5/ ** Keep rotating through steps 3 & 4.

Just a thought.
Quote:
any command that will help me to limit the size of the log file to about 10,000 lines
Try: cat LogFile-A | wc -l
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Find file size and date

Hi in my shell script I have to do this 1. there is a file called testing.txt in /home/report directory If the file size is 0(zero) and date is today's date, then I have to print "Successful" else "Failed". 2. There is a file called number.txt which will have text only one line like this... (10 Replies)
Discussion started by: gsusarla
10 Replies

2. Shell Programming and Scripting

sort files by date, delete oldest, if total size bigger than

hello people i need your help please i want to achieve the following with the simplest, most efficient shell-tools: i have a directory with a lot of files from users. the script should check which partition the dir is on if the partition with the directory is more than 90% full ... (2 Replies)
Discussion started by: scarfake
2 Replies

3. Shell Programming and Scripting

delete file by date

Hello everyone, I have a folder with many files.the script (csh) runs daily and adds a new file to the folder.I need to delete the first file added that month so I will have only 30 files left every day. Thanks. (6 Replies)
Discussion started by: offerbukra
6 Replies

4. Shell Programming and Scripting

get file size by date for a directory

Good day Probably a simple script though I am new to attempting to script. I have a directory that I would like to get the size of the files and number of files for each date ie 14 Sep 669 files 1.8g 12 Sep 221 files 500mb Any ideas? Thanks (1 Reply)
Discussion started by: ibaboomer
1 Replies

5. Shell Programming and Scripting

Perl Script to check file date and size

Hi guys, i am new to perl. I started reading the perl documents and try to come up with some logic. I am trying to create a script that would go into a location, search for todays files, then searches for all .txt files from today. If todays not found, its an error If file size is less... (26 Replies)
Discussion started by: DallasT
26 Replies

6. UNIX for Dummies Questions & Answers

Delete a row from a file if one column containing a date is greater than the current system date

Hello gurus, I am hoping someone can help me with the required code/script to make this work. I have the following file with records starting at line 4: NETW~US60~000000000013220694~002~~IT~USD~2.24~20110201~99991231~01~01~20101104~... (4 Replies)
Discussion started by: chumsky
4 Replies

7. Shell Programming and Scripting

Script to Compare file size and delete the smaller

I am pretty new to scripting, so I appreciate your advice in advance. The problem: 100 directories each containing 2 files that have the same extension with random names. The only attribute that discriminates the files is size. I would like to write a script that compares the files for size... (6 Replies)
Discussion started by: JC_1
6 Replies

8. HP-UX

find command to display size and date of a file

Hi, The blow code does not yeild any output. find . -name "*.jar" -o -name "*.ksh" -o -name "*.properties" -name "*.war" -o -name "*.ear" -o -name "*.sh" -o -name "*.cfg" -exec ls -l {} \; I wish to print the filename filesize filedate in HP-UX. Can anyone help ? (9 Replies)
Discussion started by: mohtashims
9 Replies

9. 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

10. Shell Programming and Scripting

Script to determine Date,TotalFile,total size of file based on date

I have file listed like below -rw-r--r--+ 1 test test 17M Nov 26 14:43 test1.gz -rw-r--r--+ 1 test test 0 Nov 26 14:44 test2.gz -rw-r--r--+ 1 test test 0 Nov 27 10:41 test3.gz -rw-r--r--+ 1 test test 244K Nov 27 10:41 test4.gz -rw-r--r--+ 1 test test 17M Nov 27 10:41 test5.gz I... (5 Replies)
Discussion started by: krish2014
5 Replies
RESIZE_LFS(8)						    BSD System Manager's Manual 					     RESIZE_LFS(8)

NAME
resize_lfs -- resize a mounted log-structured filesystem SYNOPSIS
resize_lfs [-v] [-s new-size] mounted-file-system DESCRIPTION
resize_lfs grows or shrinks a mounted log-structured filesystem to the specified size. mounted-file-system is the name of the filesystem to be resized, and new-size is the desired new filesystem size, in sectors. If new-size is not specified, resize_lfs will default to the cur- rent size of the partition containing the filesystem in question. When growing, the partition must be large enough to contain a filesystem of the specified size; when shrinking, resize_lfs must first ``clean'' the segments that will be invalid when the filesystem is shrunk. If this cleaning process results in these segments becoming redirtied, this indicates that the given new size is not large enough to contain the existing filesystem data, and resize_lfs will return an error. EXAMPLES
To resize the file system mounted at /home to 32576 sectors: resize_lfs -s 32576 /home SEE ALSO
fsck_lfs(8), lfs_cleanerd(8), newfs_lfs(8) HISTORY
The resize_lfs command first appeared in NetBSD 3.0. AUTHORS
Konrad Schroder <perseant@NetBSD.org> BUGS
resize_lfs should be able to resize an unmounted filesystem as well. BSD
September 4, 2006 BSD
All times are GMT -4. The time now is 04:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy