Logrotate Error : unknown option & unexpected text
up vote
0
down vote
favorite
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
centos logrotate
New contributor
add a comment |
up vote
0
down vote
favorite
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
centos logrotate
New contributor
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
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
centos logrotate
New contributor
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
centos logrotate
centos logrotate
New contributor
New contributor
edited 2 days ago
Ipor Sircer
10k11023
10k11023
New contributor
asked 2 days ago
user320883
1
1
New contributor
New contributor
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
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.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
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.
add a comment |
up vote
1
down vote
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.
add a comment |
up vote
1
down vote
up vote
1
down vote
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.
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.
edited yesterday
answered 2 days ago
Kusalananda
115k15218351
115k15218351
add a comment |
add a comment |
user320883 is a new contributor. Be nice, and check out our Code of Conduct.
user320883 is a new contributor. Be nice, and check out our Code of Conduct.
user320883 is a new contributor. Be nice, and check out our Code of Conduct.
user320883 is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f481622%2flogrotate-error-unknown-option-unexpected-text%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown