[prog] bash scipt question

Chris Henderson henders254 at gmail.com
Tue Jul 29 08:02:01 UTC 2008


Thanks for your help, Tricia.

My replies inline...

On Tue, Jul 29, 2008 at 12:29 AM, Tricia Bowen <tricia.bowen at gmail.com> wrote:
> Hi Chris,
> Can you provide some additional debugging information? Are you trying the -d
> option for logrotate? Can you get the barebones of logrotate to work?

logrotate doesn't work as another process (snmp_collect) has already
opened a file descriptor to the log file and writing to it. The only
option is to (a) stop that other process (b) rotate the log, and (c)
start the other process again.

I am just not sure how to go about doing that part.

> Something in the logrotate config file like:
>
> "/home/snmp/logs/snmp.log" {
>            rotate 5
>            size=10k
>            postrotate
>                                      pkill snmp_collect
>            endscript
>        }

> Also, how are you running your snmp_collect.sh script? Is it running as a
> cronjob?


Sorry about the typo - it's not "snmp_collect.sh", just "snmp_collect"
- it's a C program that collects SNMP logs (I don't have the source
code).

Thanks for any further help.


More information about the Programming mailing list