0

I am trying to use logrotate ,

I have create file in logrotate.d directory with "rotatetest" name. Please see below detail in file:

/etc/rsa/rotatetest { create size 100k rotate 10 missingok compress dateext postrotate service rsyslog restart endscript } 

when i tried to run logrotate -f rotatetest , it given error as below

error: rotatetest:1 unknown option 'Oct' -- ignoring line error: rotatetest:1 unexpected text error: rotatetest:2 unknown option 'Oct' -- ignoring line error: rotatetest:2 unexpected text error: rotatetest:3 unknown option 'Oct' -- ignoring line error: rotatetest:3 unexpected text 
0

1 Answer 1

1

When you give the command logrotate -f rotatetest to rotate the logs according to the rotatetest configuration file, the command would pick up the rotatetest file from the current directory.

It seems plausible that your current working directory may be /etc/rsa. This would cause logrotate to try using your logfile as its configuration file. Since it can't make heads or tails of the logfile, it complains. It's the Oct string in the error message that makes me think that it tries to use the logfile as a configuration file.

Instead, use

logrotate -f /etc/logrotate.d/rotatetest 

so that logrotate picks up the correct configuration file.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.