Logrotate/ bash script not rotating file
I'm collecting sflow data from a switch to a file. At 2300 every night I want
to roll-over the file to file.1 and start with a new file. But it looks like the log rotation is not happening : at 2200 my sflow data collection stops. Following is the way I'm doing it. collect.sh shell script calls a C program to collect the sflow data, filter the output and send the filtered data to /tmp/sflow.log file. I run this script from the CLI as root: collect.sh script: Code:
/tmp/sflow.log log to /tmp/sflow.log.1 and start the collect.sh shell script again & starts collecting log to /tmp/sflow.log. I run this script from root's crontab as: Quote:
Code:
Code:
|
Quote:
just a little idea: maybe in "rotate.sh" you need to specify the absolute path of "slow_logrotate" file? What happened if you try: logrotate -d /path/to/sflow_logrotate ? |
Solved: it was the rotate.sh script which ended after the kill -9 command because it was killing itself. Replaced $PKILL -9 sflow with $PKILL -9 sflowtool - solved the problem.
|
All times are GMT -5. The time now is 11:18 PM. |