![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Filesystems, Disks and Memory Questions involving NAS, SAN, RAID, Robotic Libraries, backups, etc go here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| sort files by date, delete oldest, if total size bigger than | scarfake | Shell Programming and Scripting | 2 | 05-21-2008 05:02 AM |
| Find file size and date | gsusarla | UNIX for Advanced & Expert Users | 10 | 04-08-2008 02:33 PM |
| How can i delete files in folder by date? | kobibn | UNIX for Dummies Questions & Answers | 9 | 10-25-2007 03:04 PM |
| command to find out total size of a specific file size (spread over the server) | abhinov | SUN Solaris | 3 | 08-08-2007 03:48 AM |
| how to delete files by date | jamesbond | UNIX for Dummies Questions & Answers | 2 | 10-12-2001 07:34 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi Everyone,
This forum has been a great help to me as a new newbie in Unix. Thanks to you all. My ? now is I have a log file that help me keep track of errors within my program. But the size of the log file keeps growing and I am wondering if there is any command that will help me to limit the size of the log file to about 10,000 lines. Or since I capture both the date and time stamp and the error message, is there anyway I can write a code to help keep up to say about 10 days of error within my log file. Thanks for your help. Odogbolu98 |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
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:
|
||||
| Google The UNIX and Linux Forums |