Logrotate doesn't rotate logs
up vote
1
down vote
favorite
I want to use logrorate. The logs are written to /var/log/curLog/log.log
. As mentioned in the documentation, I create a new file in /etc/logrotate.d/
with name currentLog
. The content of currentLog
is:
/var/log/curLog/log.log{
size 100k,
rotate 10,
daily,
compress,
notifempty
missingok
}
But the logs increase above the 100k size, and nothing happens.
Should I restart some service or do some other operations?
logrotate
add a comment |
up vote
1
down vote
favorite
I want to use logrorate. The logs are written to /var/log/curLog/log.log
. As mentioned in the documentation, I create a new file in /etc/logrotate.d/
with name currentLog
. The content of currentLog
is:
/var/log/curLog/log.log{
size 100k,
rotate 10,
daily,
compress,
notifempty
missingok
}
But the logs increase above the 100k size, and nothing happens.
Should I restart some service or do some other operations?
logrotate
No logrotate runs with cron not as a deamon. That article may help:rackspace.com/knowledge_center/article/…
– alpert
Aug 25 '14 at 8:44
Remove the commas, and it should work fine.
– Christopher
Aug 25 '14 at 11:56
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I want to use logrorate. The logs are written to /var/log/curLog/log.log
. As mentioned in the documentation, I create a new file in /etc/logrotate.d/
with name currentLog
. The content of currentLog
is:
/var/log/curLog/log.log{
size 100k,
rotate 10,
daily,
compress,
notifempty
missingok
}
But the logs increase above the 100k size, and nothing happens.
Should I restart some service or do some other operations?
logrotate
I want to use logrorate. The logs are written to /var/log/curLog/log.log
. As mentioned in the documentation, I create a new file in /etc/logrotate.d/
with name currentLog
. The content of currentLog
is:
/var/log/curLog/log.log{
size 100k,
rotate 10,
daily,
compress,
notifempty
missingok
}
But the logs increase above the 100k size, and nothing happens.
Should I restart some service or do some other operations?
logrotate
logrotate
edited Nov 24 at 20:09
Rui F Ribeiro
38.3k1476127
38.3k1476127
asked Aug 25 '14 at 8:22
Or Smith
1132
1132
No logrotate runs with cron not as a deamon. That article may help:rackspace.com/knowledge_center/article/…
– alpert
Aug 25 '14 at 8:44
Remove the commas, and it should work fine.
– Christopher
Aug 25 '14 at 11:56
add a comment |
No logrotate runs with cron not as a deamon. That article may help:rackspace.com/knowledge_center/article/…
– alpert
Aug 25 '14 at 8:44
Remove the commas, and it should work fine.
– Christopher
Aug 25 '14 at 11:56
No logrotate runs with cron not as a deamon. That article may help:rackspace.com/knowledge_center/article/…
– alpert
Aug 25 '14 at 8:44
No logrotate runs with cron not as a deamon. That article may help:rackspace.com/knowledge_center/article/…
– alpert
Aug 25 '14 at 8:44
Remove the commas, and it should work fine.
– Christopher
Aug 25 '14 at 11:56
Remove the commas, and it should work fine.
– Christopher
Aug 25 '14 at 11:56
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
You have 3 options that dictate the when the rotation occurs.
size 100k # if size > 100k
daily # once a day
notifempty # not if == 0k
Remove the daily
and it should occur more regularly when the file is > 100k
Second, If the process that creates the log file is a daemon that keeps the file open, you will most likely need to restart that process or at least signal it to open a new log file once logrotate has moved the old one.
For example, Apache httpd can graciously reload config and reopen log files with the kill -SIGUSR1 <pid>
or /usr/sbin/apachectl graceful
command rather than being completely restarted.
postrotate
/usr/sbin/apachectl graceful > /dev/null
endscript
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
You have 3 options that dictate the when the rotation occurs.
size 100k # if size > 100k
daily # once a day
notifempty # not if == 0k
Remove the daily
and it should occur more regularly when the file is > 100k
Second, If the process that creates the log file is a daemon that keeps the file open, you will most likely need to restart that process or at least signal it to open a new log file once logrotate has moved the old one.
For example, Apache httpd can graciously reload config and reopen log files with the kill -SIGUSR1 <pid>
or /usr/sbin/apachectl graceful
command rather than being completely restarted.
postrotate
/usr/sbin/apachectl graceful > /dev/null
endscript
add a comment |
up vote
0
down vote
You have 3 options that dictate the when the rotation occurs.
size 100k # if size > 100k
daily # once a day
notifempty # not if == 0k
Remove the daily
and it should occur more regularly when the file is > 100k
Second, If the process that creates the log file is a daemon that keeps the file open, you will most likely need to restart that process or at least signal it to open a new log file once logrotate has moved the old one.
For example, Apache httpd can graciously reload config and reopen log files with the kill -SIGUSR1 <pid>
or /usr/sbin/apachectl graceful
command rather than being completely restarted.
postrotate
/usr/sbin/apachectl graceful > /dev/null
endscript
add a comment |
up vote
0
down vote
up vote
0
down vote
You have 3 options that dictate the when the rotation occurs.
size 100k # if size > 100k
daily # once a day
notifempty # not if == 0k
Remove the daily
and it should occur more regularly when the file is > 100k
Second, If the process that creates the log file is a daemon that keeps the file open, you will most likely need to restart that process or at least signal it to open a new log file once logrotate has moved the old one.
For example, Apache httpd can graciously reload config and reopen log files with the kill -SIGUSR1 <pid>
or /usr/sbin/apachectl graceful
command rather than being completely restarted.
postrotate
/usr/sbin/apachectl graceful > /dev/null
endscript
You have 3 options that dictate the when the rotation occurs.
size 100k # if size > 100k
daily # once a day
notifempty # not if == 0k
Remove the daily
and it should occur more regularly when the file is > 100k
Second, If the process that creates the log file is a daemon that keeps the file open, you will most likely need to restart that process or at least signal it to open a new log file once logrotate has moved the old one.
For example, Apache httpd can graciously reload config and reopen log files with the kill -SIGUSR1 <pid>
or /usr/sbin/apachectl graceful
command rather than being completely restarted.
postrotate
/usr/sbin/apachectl graceful > /dev/null
endscript
answered Aug 25 '14 at 8:55
Matt
5,94511625
5,94511625
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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%2f152028%2flogrotate-doesnt-rotate-logs%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
No logrotate runs with cron not as a deamon. That article may help:rackspace.com/knowledge_center/article/…
– alpert
Aug 25 '14 at 8:44
Remove the commas, and it should work fine.
– Christopher
Aug 25 '14 at 11:56