![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| logrotate with /etc/logrotate.conf file | skmdu | UNIX for Advanced & Expert Users | 2 | 10-17-2009 07:04 AM |
| logrotate isn't rotating files any longer | manouche | UNIX for Advanced & Expert Users | 1 | 06-17-2009 04:21 PM |
| logrotate question | manouche | UNIX for Advanced & Expert Users | 1 | 01-29-2009 02:38 AM |
| logrotate bug? | jjinno | UNIX for Advanced & Expert Users | 0 | 06-09-2008 04:24 PM |
| Disabling logrotate | primal | UNIX for Dummies Questions & Answers | 2 | 04-14-2008 01:19 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hi,
I have written a script that runs every five minutes in cron schedular. The Operating system is Fedora core 9. This script generates 2 log files, these log file size is increasing as some log data is being dumped into these 2 log files every five minutes. I need to logrotate these 2 files. Could someone help me with the steps to configure logrotate for the 2 files? Thanks in advance |
|
||||
|
re: how to logrotate files
If you have logrotate installed (chances are you do) then there should be a few files in /etc/logrotate.d that you can look at to give examples of how to use logrotate to do daily log rotations. The format is fairly straighforward - the names of the files to be rotated, follwed by a list of configuration options in {}. The /etc/logrotate.conf file contains system wide defaults.
Look at the man pages (man logrotate) to find out what the options mean and pay particular attention to the 'create' and 'copytruncate' sections. Since your script is running out of cron you likely don't need to worry about signaling it to start a new log file, however you will want to be careful about what would happen if logrotate runs at the same time as your script. Logrotate itself is called by cron once per day so if you need more frequent log rotation you'll need to set that up manually. You can look at the /etc/crontab file to find out when the scripts in /etc/cron.daily folder are going to be run. (That's where logrotate is called) Cheers, Anthony |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|