logrotate status files extremely large Unicorn Meta Zoo #1: Why another podcast? ...
Married in secret, can marital status in passport be changed at a later date?
What to do with someone that cheated their way through university and a PhD program?
What is the best way to deal with NPC-NPC combat?
Can you stand up from being prone using Skirmisher outside of your turn?
"Rubric" as meaning "signature" or "personal mark" -- is this accepted usage?
What is the ongoing value of the Kanban board to the developers as opposed to management
"My boss was furious with me and I have been fired" vs. "My boss was furious with me and I was fired"
Passing args from the bash script to the function in the script
Arriving in Atlanta after US Preclearance in Dublin. Will I go through TSA security in Atlanta to transfer to a connecting flight?
Does Feeblemind produce an ongoing magical effect that can be dispelled?
How to keep bees out of canned beverages?
How to translate "red flag" into Spanish?
Protagonist's race is hidden - should I reveal it?
How long after the last departure shall the airport stay open for an emergency return?
As an international instructor, should I openly talk about my accent?
Check if a string is entirely made of the same substring
All ASCII characters with a given bit count
I preordered a game on my Xbox while on the home screen of my friend's account. Which of us owns the game?
Second order approximation of the loss function (Deep learning book, 7.33)
What *exactly* is electrical current, voltage, and resistance?
Could moose/elk survive in the Amazon forest?
Justification for leaving new position after a short time
Has a Nobel Peace laureate ever been accused of war crimes?
Is accepting an invalid credit card number a security issue?
logrotate status files extremely large
Unicorn Meta Zoo #1: Why another podcast?
Announcing the arrival of Valued Associate #679: Cesar Manara
Come Celebrate our 10 Year Anniversary!Why do JBoss and Logrotate create log files full of NUL characters?Logrotate Mysql - No rotate happensLogrotate Successful, original file goes back to original sizelogrotate not deleting old files - glob failingHow does logrotate interact with hard linked files?Making logrotate remove old logs after reducing 'rotate' valueLogrotate not rotating logs on AWS LinuxCentOS 6 - Logrotate ConfusionLogrotate Not Deleting Compressed LogsLogrotate Separate Policies in Same Directory
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
Apache2 on an Ubuntu 16.04 box was showing issues on the websites it's hosting. It was at 100% capacity. Looking further with du
, The majority of the ~100gb hard drive was filled by two files in /var/lib/logrotate/
.
logrotate
has files in there which are called /var/lib/logrotate/status
and /var/lib/logrotate/status.clean
and taking up a lot of space... 30gb and 60gb.
I'm aware that logrotate
is used to regularly clear log files but it seems that it doesn't clear it's own 'log' files by default. I resolved the disk space issue by deleting the two files in there rm -rf /var/lib/logrotate/*
.
(/var/lib/logrotate/status
has repopulated with new logs from rotate processes throughout the day)
Is this something that is going to keep happening if logrotate doesn't rotate it's own logs?
logging ubuntu-16.04 logrotate du log-rotation
add a comment |
Apache2 on an Ubuntu 16.04 box was showing issues on the websites it's hosting. It was at 100% capacity. Looking further with du
, The majority of the ~100gb hard drive was filled by two files in /var/lib/logrotate/
.
logrotate
has files in there which are called /var/lib/logrotate/status
and /var/lib/logrotate/status.clean
and taking up a lot of space... 30gb and 60gb.
I'm aware that logrotate
is used to regularly clear log files but it seems that it doesn't clear it's own 'log' files by default. I resolved the disk space issue by deleting the two files in there rm -rf /var/lib/logrotate/*
.
(/var/lib/logrotate/status
has repopulated with new logs from rotate processes throughout the day)
Is this something that is going to keep happening if logrotate doesn't rotate it's own logs?
logging ubuntu-16.04 logrotate du log-rotation
add a comment |
Apache2 on an Ubuntu 16.04 box was showing issues on the websites it's hosting. It was at 100% capacity. Looking further with du
, The majority of the ~100gb hard drive was filled by two files in /var/lib/logrotate/
.
logrotate
has files in there which are called /var/lib/logrotate/status
and /var/lib/logrotate/status.clean
and taking up a lot of space... 30gb and 60gb.
I'm aware that logrotate
is used to regularly clear log files but it seems that it doesn't clear it's own 'log' files by default. I resolved the disk space issue by deleting the two files in there rm -rf /var/lib/logrotate/*
.
(/var/lib/logrotate/status
has repopulated with new logs from rotate processes throughout the day)
Is this something that is going to keep happening if logrotate doesn't rotate it's own logs?
logging ubuntu-16.04 logrotate du log-rotation
Apache2 on an Ubuntu 16.04 box was showing issues on the websites it's hosting. It was at 100% capacity. Looking further with du
, The majority of the ~100gb hard drive was filled by two files in /var/lib/logrotate/
.
logrotate
has files in there which are called /var/lib/logrotate/status
and /var/lib/logrotate/status.clean
and taking up a lot of space... 30gb and 60gb.
I'm aware that logrotate
is used to regularly clear log files but it seems that it doesn't clear it's own 'log' files by default. I resolved the disk space issue by deleting the two files in there rm -rf /var/lib/logrotate/*
.
(/var/lib/logrotate/status
has repopulated with new logs from rotate processes throughout the day)
Is this something that is going to keep happening if logrotate doesn't rotate it's own logs?
logging ubuntu-16.04 logrotate du log-rotation
logging ubuntu-16.04 logrotate du log-rotation
edited Dec 19 '17 at 1:16
Angelo
asked Dec 18 '17 at 21:44
AngeloAngelo
63
63
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
You can setup a cron job to either clean up or rotate/truncate the logrotate.status file on a routine basis. I'd recommend a weekly one if your server volume is moderate, daily if extremely heavy traffic.
To setup a weekly cron job that resets the logrotate.status file:
- open cron
crontab -e
- add the entry
* * * * 1 echo > /var/lib/logrotate.status
To setup rotation of the file every week:
Create a script (make sure it's executable by the cron user) and run a weekly cron to call the it.
Example Script:
#!/bin/bash
/bin/mv /var/lib/logrotate.status.3 /var/lib/logrotate.status.4
/bin/mv /var/lib/logrotate.status.2 /var/lib/logrotate.status.3
/bin/mv /var/lib/logrotate.status.1 /var/lib/logrotate.status.2
/bin/mv /var/lib/logrotate.status /var/lib/logrotate.status.1
To set the script's file permissions:
chmod u+x [script-filename]
Cron task format:
* * * * 1 /full/path/to/your/script
the order ofmv
commands in your script sample looks funny. i think you meant something different.
– anx
Dec 19 '17 at 5:13
you're right, it's backwards. It should be rotate oldest first, newest last. My bad- edited to refect proper order.
– Anson W Han
Dec 19 '17 at 5:16
This line will cause issues with all logrotate processes...echo > /var/lib/logrotate.status
. This answer is very similar with what is found here however it is not a solution. (The echo command will leave a blank line in the file thus corrupting the file and stopping logs from rotating)
– Angelo
Dec 19 '17 at 14:29
This does not seem to be a solution. One should look into why the files are so huge, possibly there are wrong patterns in the configuration.
– Richlv
Sep 12 '18 at 6:17
add a comment |
Deleting or rotating the logrotate.status
file is only a band-aid. You need to take a step backward and ask the question, "why is the logrotate.status
file that large?"
I would tail -n 500
that status file and see what files are listed in there. I think there's a real strong possibility that your logrotate config file(s) are rotating stuff you never intended to be rotated.
New contributor
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "2"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
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%2fserverfault.com%2fquestions%2f888757%2flogrotate-status-files-extremely-large%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can setup a cron job to either clean up or rotate/truncate the logrotate.status file on a routine basis. I'd recommend a weekly one if your server volume is moderate, daily if extremely heavy traffic.
To setup a weekly cron job that resets the logrotate.status file:
- open cron
crontab -e
- add the entry
* * * * 1 echo > /var/lib/logrotate.status
To setup rotation of the file every week:
Create a script (make sure it's executable by the cron user) and run a weekly cron to call the it.
Example Script:
#!/bin/bash
/bin/mv /var/lib/logrotate.status.3 /var/lib/logrotate.status.4
/bin/mv /var/lib/logrotate.status.2 /var/lib/logrotate.status.3
/bin/mv /var/lib/logrotate.status.1 /var/lib/logrotate.status.2
/bin/mv /var/lib/logrotate.status /var/lib/logrotate.status.1
To set the script's file permissions:
chmod u+x [script-filename]
Cron task format:
* * * * 1 /full/path/to/your/script
the order ofmv
commands in your script sample looks funny. i think you meant something different.
– anx
Dec 19 '17 at 5:13
you're right, it's backwards. It should be rotate oldest first, newest last. My bad- edited to refect proper order.
– Anson W Han
Dec 19 '17 at 5:16
This line will cause issues with all logrotate processes...echo > /var/lib/logrotate.status
. This answer is very similar with what is found here however it is not a solution. (The echo command will leave a blank line in the file thus corrupting the file and stopping logs from rotating)
– Angelo
Dec 19 '17 at 14:29
This does not seem to be a solution. One should look into why the files are so huge, possibly there are wrong patterns in the configuration.
– Richlv
Sep 12 '18 at 6:17
add a comment |
You can setup a cron job to either clean up or rotate/truncate the logrotate.status file on a routine basis. I'd recommend a weekly one if your server volume is moderate, daily if extremely heavy traffic.
To setup a weekly cron job that resets the logrotate.status file:
- open cron
crontab -e
- add the entry
* * * * 1 echo > /var/lib/logrotate.status
To setup rotation of the file every week:
Create a script (make sure it's executable by the cron user) and run a weekly cron to call the it.
Example Script:
#!/bin/bash
/bin/mv /var/lib/logrotate.status.3 /var/lib/logrotate.status.4
/bin/mv /var/lib/logrotate.status.2 /var/lib/logrotate.status.3
/bin/mv /var/lib/logrotate.status.1 /var/lib/logrotate.status.2
/bin/mv /var/lib/logrotate.status /var/lib/logrotate.status.1
To set the script's file permissions:
chmod u+x [script-filename]
Cron task format:
* * * * 1 /full/path/to/your/script
the order ofmv
commands in your script sample looks funny. i think you meant something different.
– anx
Dec 19 '17 at 5:13
you're right, it's backwards. It should be rotate oldest first, newest last. My bad- edited to refect proper order.
– Anson W Han
Dec 19 '17 at 5:16
This line will cause issues with all logrotate processes...echo > /var/lib/logrotate.status
. This answer is very similar with what is found here however it is not a solution. (The echo command will leave a blank line in the file thus corrupting the file and stopping logs from rotating)
– Angelo
Dec 19 '17 at 14:29
This does not seem to be a solution. One should look into why the files are so huge, possibly there are wrong patterns in the configuration.
– Richlv
Sep 12 '18 at 6:17
add a comment |
You can setup a cron job to either clean up or rotate/truncate the logrotate.status file on a routine basis. I'd recommend a weekly one if your server volume is moderate, daily if extremely heavy traffic.
To setup a weekly cron job that resets the logrotate.status file:
- open cron
crontab -e
- add the entry
* * * * 1 echo > /var/lib/logrotate.status
To setup rotation of the file every week:
Create a script (make sure it's executable by the cron user) and run a weekly cron to call the it.
Example Script:
#!/bin/bash
/bin/mv /var/lib/logrotate.status.3 /var/lib/logrotate.status.4
/bin/mv /var/lib/logrotate.status.2 /var/lib/logrotate.status.3
/bin/mv /var/lib/logrotate.status.1 /var/lib/logrotate.status.2
/bin/mv /var/lib/logrotate.status /var/lib/logrotate.status.1
To set the script's file permissions:
chmod u+x [script-filename]
Cron task format:
* * * * 1 /full/path/to/your/script
You can setup a cron job to either clean up or rotate/truncate the logrotate.status file on a routine basis. I'd recommend a weekly one if your server volume is moderate, daily if extremely heavy traffic.
To setup a weekly cron job that resets the logrotate.status file:
- open cron
crontab -e
- add the entry
* * * * 1 echo > /var/lib/logrotate.status
To setup rotation of the file every week:
Create a script (make sure it's executable by the cron user) and run a weekly cron to call the it.
Example Script:
#!/bin/bash
/bin/mv /var/lib/logrotate.status.3 /var/lib/logrotate.status.4
/bin/mv /var/lib/logrotate.status.2 /var/lib/logrotate.status.3
/bin/mv /var/lib/logrotate.status.1 /var/lib/logrotate.status.2
/bin/mv /var/lib/logrotate.status /var/lib/logrotate.status.1
To set the script's file permissions:
chmod u+x [script-filename]
Cron task format:
* * * * 1 /full/path/to/your/script
edited Dec 19 '17 at 5:16
answered Dec 19 '17 at 4:38
Anson W HanAnson W Han
36616
36616
the order ofmv
commands in your script sample looks funny. i think you meant something different.
– anx
Dec 19 '17 at 5:13
you're right, it's backwards. It should be rotate oldest first, newest last. My bad- edited to refect proper order.
– Anson W Han
Dec 19 '17 at 5:16
This line will cause issues with all logrotate processes...echo > /var/lib/logrotate.status
. This answer is very similar with what is found here however it is not a solution. (The echo command will leave a blank line in the file thus corrupting the file and stopping logs from rotating)
– Angelo
Dec 19 '17 at 14:29
This does not seem to be a solution. One should look into why the files are so huge, possibly there are wrong patterns in the configuration.
– Richlv
Sep 12 '18 at 6:17
add a comment |
the order ofmv
commands in your script sample looks funny. i think you meant something different.
– anx
Dec 19 '17 at 5:13
you're right, it's backwards. It should be rotate oldest first, newest last. My bad- edited to refect proper order.
– Anson W Han
Dec 19 '17 at 5:16
This line will cause issues with all logrotate processes...echo > /var/lib/logrotate.status
. This answer is very similar with what is found here however it is not a solution. (The echo command will leave a blank line in the file thus corrupting the file and stopping logs from rotating)
– Angelo
Dec 19 '17 at 14:29
This does not seem to be a solution. One should look into why the files are so huge, possibly there are wrong patterns in the configuration.
– Richlv
Sep 12 '18 at 6:17
the order of
mv
commands in your script sample looks funny. i think you meant something different.– anx
Dec 19 '17 at 5:13
the order of
mv
commands in your script sample looks funny. i think you meant something different.– anx
Dec 19 '17 at 5:13
you're right, it's backwards. It should be rotate oldest first, newest last. My bad- edited to refect proper order.
– Anson W Han
Dec 19 '17 at 5:16
you're right, it's backwards. It should be rotate oldest first, newest last. My bad- edited to refect proper order.
– Anson W Han
Dec 19 '17 at 5:16
This line will cause issues with all logrotate processes...
echo > /var/lib/logrotate.status
. This answer is very similar with what is found here however it is not a solution. (The echo command will leave a blank line in the file thus corrupting the file and stopping logs from rotating)– Angelo
Dec 19 '17 at 14:29
This line will cause issues with all logrotate processes...
echo > /var/lib/logrotate.status
. This answer is very similar with what is found here however it is not a solution. (The echo command will leave a blank line in the file thus corrupting the file and stopping logs from rotating)– Angelo
Dec 19 '17 at 14:29
This does not seem to be a solution. One should look into why the files are so huge, possibly there are wrong patterns in the configuration.
– Richlv
Sep 12 '18 at 6:17
This does not seem to be a solution. One should look into why the files are so huge, possibly there are wrong patterns in the configuration.
– Richlv
Sep 12 '18 at 6:17
add a comment |
Deleting or rotating the logrotate.status
file is only a band-aid. You need to take a step backward and ask the question, "why is the logrotate.status
file that large?"
I would tail -n 500
that status file and see what files are listed in there. I think there's a real strong possibility that your logrotate config file(s) are rotating stuff you never intended to be rotated.
New contributor
add a comment |
Deleting or rotating the logrotate.status
file is only a band-aid. You need to take a step backward and ask the question, "why is the logrotate.status
file that large?"
I would tail -n 500
that status file and see what files are listed in there. I think there's a real strong possibility that your logrotate config file(s) are rotating stuff you never intended to be rotated.
New contributor
add a comment |
Deleting or rotating the logrotate.status
file is only a band-aid. You need to take a step backward and ask the question, "why is the logrotate.status
file that large?"
I would tail -n 500
that status file and see what files are listed in there. I think there's a real strong possibility that your logrotate config file(s) are rotating stuff you never intended to be rotated.
New contributor
Deleting or rotating the logrotate.status
file is only a band-aid. You need to take a step backward and ask the question, "why is the logrotate.status
file that large?"
I would tail -n 500
that status file and see what files are listed in there. I think there's a real strong possibility that your logrotate config file(s) are rotating stuff you never intended to be rotated.
New contributor
New contributor
answered 3 mins ago
user3629081user3629081
101
101
New contributor
New contributor
add a comment |
add a comment |
Thanks for contributing an answer to Server Fault!
- 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%2fserverfault.com%2fquestions%2f888757%2flogrotate-status-files-extremely-large%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