logrotate status files extremely largeWhy 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 LinuxLogrotate Not Deleting Compressed LogsLogrotate Separate Policies in Same Directory
How to use dependency injection and avoid temporal coupling?
Adjacent DEM color matching in QGIS
Building a list of products from the elements in another list
Is there an idiom that support the idea that "inflation is bad"?
What is a smasher?
My advisor talks about me to his colleague
How should I tell my manager I'm not paying for an optional after work event I'm not going to?
Why do people keep telling me that I am a bad photographer?
What are the differences between credential stuffing and password spraying?
Where is the documentation for this ex command?
What is the solution to this metapuzzle from a university puzzling column?
Find the cheapest shipping option based on item weight
Pressure inside an infinite ocean?
Word meaning as function of the composition of its phonemes
In Russian, how do you idiomatically express the idea of the figurative "overnight"?
Are the Night's Watch still required?
Should I mention being denied entry to UK due to a confusion in my Visa and Ticket bookings?
Nominativ or Akkusativ
29er Road Tire?
Wrong answer from DSolve when solving a differential equation
Word for Food that's Gone 'Bad', but is Still Edible?
Why does sound not move through a wall?
Does the 7th major scale note resolve more strongly to the lower tonic (note 1) than the higher tonic (note 8)?
PWM 1Hz on solid state relay
logrotate status files extremely large
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 LinuxLogrotate 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.
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.
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.
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.
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.
answered Apr 25 at 3:04
user3629081user3629081
1062
1062
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