logrotate: error opening (No such file or directory)
I got an error message. This is sent to my mail box automatically.
/etc/cron.daily/logrotate:
error: error opening /var/log/apache2/access.log.1.gz: No such file or directory
error: error opening /var/log/apache2/myhost/access.log.1.gz: No such file or directory
I also check my /var/log/apache2/*
and /var/log/apache2/myhost/*
those directories. There aren't the file access.log.1.gz
, but definitely a file access.log.1
existed on the directories. I just start to configure logrotate
this tool for my log file management and my apache have run for a long period, at least 30 log files existed on my directories. Currently, I have no idea why it happened like this.
My /etc/logrotate
is as below:
/var/log/apache2/*.log {
daily
missingok
rotate 10
compress
delaycompress
# notifempty
create 640 root adm
sharedscripts
postrotate
/etc/init.d/apache2 reload > /dev/null;
endscript
prerotate
if [ -d /etc/logrotate.d/httpd-prerotate ]; then
run-parts /etc/logrotate.d/httpd-prerotate;
fi;
endscript
}
/var/log/apache2/myhost/*.log {
daily
missingok
rotate 10
compress
delaycompress
# notifempty
create 640 root adm
sharedscripts
postrotate
/etc/init.d/apache2 reload > /dev/null;
endscript
prerotate
if [ -d /etc/logrotate.d/httpd-prerotate ]; then
run-parts /etc/logrotate.d/httpd-prerotate;
fi;
endscript
}
apache-httpd logrotate logs
add a comment |
I got an error message. This is sent to my mail box automatically.
/etc/cron.daily/logrotate:
error: error opening /var/log/apache2/access.log.1.gz: No such file or directory
error: error opening /var/log/apache2/myhost/access.log.1.gz: No such file or directory
I also check my /var/log/apache2/*
and /var/log/apache2/myhost/*
those directories. There aren't the file access.log.1.gz
, but definitely a file access.log.1
existed on the directories. I just start to configure logrotate
this tool for my log file management and my apache have run for a long period, at least 30 log files existed on my directories. Currently, I have no idea why it happened like this.
My /etc/logrotate
is as below:
/var/log/apache2/*.log {
daily
missingok
rotate 10
compress
delaycompress
# notifempty
create 640 root adm
sharedscripts
postrotate
/etc/init.d/apache2 reload > /dev/null;
endscript
prerotate
if [ -d /etc/logrotate.d/httpd-prerotate ]; then
run-parts /etc/logrotate.d/httpd-prerotate;
fi;
endscript
}
/var/log/apache2/myhost/*.log {
daily
missingok
rotate 10
compress
delaycompress
# notifempty
create 640 root adm
sharedscripts
postrotate
/etc/init.d/apache2 reload > /dev/null;
endscript
prerotate
if [ -d /etc/logrotate.d/httpd-prerotate ]; then
run-parts /etc/logrotate.d/httpd-prerotate;
fi;
endscript
}
apache-httpd logrotate logs
What do you have in/etc/logrotate.d/httpd-prerotate
? You should probably not do it twice, norapache2 reload
in fact but this is what you are doing because of the two types of logs where in fact they pertain to the same "system" (Apache). Also you seem to miss a '*' it sould be*.log
twice not just.log
. You can also launchlogrotate
with the-d
option to see what it is doing.
– Patrick Mevzek
Feb 12 '17 at 15:01
Hi, I mark one of them due to your saying that the /etc/logrotate.d/httpd-prerotate is not existed actually. What do you mean *.log and .log? Here I do not know clearly. I run "logrotate -d apache2" this command. Shows up as below: "removing old log /var/log/apache2/myhost/access.log.1.gz error: error opening /var/log/apache2/myhost/access.log.1.gz: No such file or directory." I check my directory and get list which there are access.log, access.log.1, access.log.2.gz, access.log.3.gz, access.log.4.gz and etc... But, there aren't anyone called as "access.log.1.gz". Is this to make it stop?
– jefferyear
Feb 12 '17 at 16:54
Hi, I got the recent message on my mail box. <code> /etc/cron.daily/logrotate: error: error opening /var/log/apache2/access.log.1.gz: No such file or directory error: error opening /var/log/apache2/myhost/access.log.1.gz: No such file or directory </code> It miss the first one compressed file only and then don't go through to do the next one. I want to know how to compress the first one either. This may help to let it know and continue to run the script.
– jefferyear
Feb 13 '17 at 0:11
If your current data is not important I would recommend starting from scratch. Stop Apache, delete all Apache log files, restart Apache, and let logrotate run normally. Otherwise to compressaccess.log.1
just dogzip access.log.1
– Patrick Mevzek
Feb 14 '17 at 0:39
add a comment |
I got an error message. This is sent to my mail box automatically.
/etc/cron.daily/logrotate:
error: error opening /var/log/apache2/access.log.1.gz: No such file or directory
error: error opening /var/log/apache2/myhost/access.log.1.gz: No such file or directory
I also check my /var/log/apache2/*
and /var/log/apache2/myhost/*
those directories. There aren't the file access.log.1.gz
, but definitely a file access.log.1
existed on the directories. I just start to configure logrotate
this tool for my log file management and my apache have run for a long period, at least 30 log files existed on my directories. Currently, I have no idea why it happened like this.
My /etc/logrotate
is as below:
/var/log/apache2/*.log {
daily
missingok
rotate 10
compress
delaycompress
# notifempty
create 640 root adm
sharedscripts
postrotate
/etc/init.d/apache2 reload > /dev/null;
endscript
prerotate
if [ -d /etc/logrotate.d/httpd-prerotate ]; then
run-parts /etc/logrotate.d/httpd-prerotate;
fi;
endscript
}
/var/log/apache2/myhost/*.log {
daily
missingok
rotate 10
compress
delaycompress
# notifempty
create 640 root adm
sharedscripts
postrotate
/etc/init.d/apache2 reload > /dev/null;
endscript
prerotate
if [ -d /etc/logrotate.d/httpd-prerotate ]; then
run-parts /etc/logrotate.d/httpd-prerotate;
fi;
endscript
}
apache-httpd logrotate logs
I got an error message. This is sent to my mail box automatically.
/etc/cron.daily/logrotate:
error: error opening /var/log/apache2/access.log.1.gz: No such file or directory
error: error opening /var/log/apache2/myhost/access.log.1.gz: No such file or directory
I also check my /var/log/apache2/*
and /var/log/apache2/myhost/*
those directories. There aren't the file access.log.1.gz
, but definitely a file access.log.1
existed on the directories. I just start to configure logrotate
this tool for my log file management and my apache have run for a long period, at least 30 log files existed on my directories. Currently, I have no idea why it happened like this.
My /etc/logrotate
is as below:
/var/log/apache2/*.log {
daily
missingok
rotate 10
compress
delaycompress
# notifempty
create 640 root adm
sharedscripts
postrotate
/etc/init.d/apache2 reload > /dev/null;
endscript
prerotate
if [ -d /etc/logrotate.d/httpd-prerotate ]; then
run-parts /etc/logrotate.d/httpd-prerotate;
fi;
endscript
}
/var/log/apache2/myhost/*.log {
daily
missingok
rotate 10
compress
delaycompress
# notifempty
create 640 root adm
sharedscripts
postrotate
/etc/init.d/apache2 reload > /dev/null;
endscript
prerotate
if [ -d /etc/logrotate.d/httpd-prerotate ]; then
run-parts /etc/logrotate.d/httpd-prerotate;
fi;
endscript
}
apache-httpd logrotate logs
apache-httpd logrotate logs
edited Feb 13 '17 at 4:04
Jeff Schaller
38.6k1053125
38.6k1053125
asked Feb 12 '17 at 14:12
jefferyear
4819
4819
What do you have in/etc/logrotate.d/httpd-prerotate
? You should probably not do it twice, norapache2 reload
in fact but this is what you are doing because of the two types of logs where in fact they pertain to the same "system" (Apache). Also you seem to miss a '*' it sould be*.log
twice not just.log
. You can also launchlogrotate
with the-d
option to see what it is doing.
– Patrick Mevzek
Feb 12 '17 at 15:01
Hi, I mark one of them due to your saying that the /etc/logrotate.d/httpd-prerotate is not existed actually. What do you mean *.log and .log? Here I do not know clearly. I run "logrotate -d apache2" this command. Shows up as below: "removing old log /var/log/apache2/myhost/access.log.1.gz error: error opening /var/log/apache2/myhost/access.log.1.gz: No such file or directory." I check my directory and get list which there are access.log, access.log.1, access.log.2.gz, access.log.3.gz, access.log.4.gz and etc... But, there aren't anyone called as "access.log.1.gz". Is this to make it stop?
– jefferyear
Feb 12 '17 at 16:54
Hi, I got the recent message on my mail box. <code> /etc/cron.daily/logrotate: error: error opening /var/log/apache2/access.log.1.gz: No such file or directory error: error opening /var/log/apache2/myhost/access.log.1.gz: No such file or directory </code> It miss the first one compressed file only and then don't go through to do the next one. I want to know how to compress the first one either. This may help to let it know and continue to run the script.
– jefferyear
Feb 13 '17 at 0:11
If your current data is not important I would recommend starting from scratch. Stop Apache, delete all Apache log files, restart Apache, and let logrotate run normally. Otherwise to compressaccess.log.1
just dogzip access.log.1
– Patrick Mevzek
Feb 14 '17 at 0:39
add a comment |
What do you have in/etc/logrotate.d/httpd-prerotate
? You should probably not do it twice, norapache2 reload
in fact but this is what you are doing because of the two types of logs where in fact they pertain to the same "system" (Apache). Also you seem to miss a '*' it sould be*.log
twice not just.log
. You can also launchlogrotate
with the-d
option to see what it is doing.
– Patrick Mevzek
Feb 12 '17 at 15:01
Hi, I mark one of them due to your saying that the /etc/logrotate.d/httpd-prerotate is not existed actually. What do you mean *.log and .log? Here I do not know clearly. I run "logrotate -d apache2" this command. Shows up as below: "removing old log /var/log/apache2/myhost/access.log.1.gz error: error opening /var/log/apache2/myhost/access.log.1.gz: No such file or directory." I check my directory and get list which there are access.log, access.log.1, access.log.2.gz, access.log.3.gz, access.log.4.gz and etc... But, there aren't anyone called as "access.log.1.gz". Is this to make it stop?
– jefferyear
Feb 12 '17 at 16:54
Hi, I got the recent message on my mail box. <code> /etc/cron.daily/logrotate: error: error opening /var/log/apache2/access.log.1.gz: No such file or directory error: error opening /var/log/apache2/myhost/access.log.1.gz: No such file or directory </code> It miss the first one compressed file only and then don't go through to do the next one. I want to know how to compress the first one either. This may help to let it know and continue to run the script.
– jefferyear
Feb 13 '17 at 0:11
If your current data is not important I would recommend starting from scratch. Stop Apache, delete all Apache log files, restart Apache, and let logrotate run normally. Otherwise to compressaccess.log.1
just dogzip access.log.1
– Patrick Mevzek
Feb 14 '17 at 0:39
What do you have in
/etc/logrotate.d/httpd-prerotate
? You should probably not do it twice, nor apache2 reload
in fact but this is what you are doing because of the two types of logs where in fact they pertain to the same "system" (Apache). Also you seem to miss a '*' it sould be *.log
twice not just .log
. You can also launch logrotate
with the -d
option to see what it is doing.– Patrick Mevzek
Feb 12 '17 at 15:01
What do you have in
/etc/logrotate.d/httpd-prerotate
? You should probably not do it twice, nor apache2 reload
in fact but this is what you are doing because of the two types of logs where in fact they pertain to the same "system" (Apache). Also you seem to miss a '*' it sould be *.log
twice not just .log
. You can also launch logrotate
with the -d
option to see what it is doing.– Patrick Mevzek
Feb 12 '17 at 15:01
Hi, I mark one of them due to your saying that the /etc/logrotate.d/httpd-prerotate is not existed actually. What do you mean *.log and .log? Here I do not know clearly. I run "logrotate -d apache2" this command. Shows up as below: "removing old log /var/log/apache2/myhost/access.log.1.gz error: error opening /var/log/apache2/myhost/access.log.1.gz: No such file or directory." I check my directory and get list which there are access.log, access.log.1, access.log.2.gz, access.log.3.gz, access.log.4.gz and etc... But, there aren't anyone called as "access.log.1.gz". Is this to make it stop?
– jefferyear
Feb 12 '17 at 16:54
Hi, I mark one of them due to your saying that the /etc/logrotate.d/httpd-prerotate is not existed actually. What do you mean *.log and .log? Here I do not know clearly. I run "logrotate -d apache2" this command. Shows up as below: "removing old log /var/log/apache2/myhost/access.log.1.gz error: error opening /var/log/apache2/myhost/access.log.1.gz: No such file or directory." I check my directory and get list which there are access.log, access.log.1, access.log.2.gz, access.log.3.gz, access.log.4.gz and etc... But, there aren't anyone called as "access.log.1.gz". Is this to make it stop?
– jefferyear
Feb 12 '17 at 16:54
Hi, I got the recent message on my mail box. <code> /etc/cron.daily/logrotate: error: error opening /var/log/apache2/access.log.1.gz: No such file or directory error: error opening /var/log/apache2/myhost/access.log.1.gz: No such file or directory </code> It miss the first one compressed file only and then don't go through to do the next one. I want to know how to compress the first one either. This may help to let it know and continue to run the script.
– jefferyear
Feb 13 '17 at 0:11
Hi, I got the recent message on my mail box. <code> /etc/cron.daily/logrotate: error: error opening /var/log/apache2/access.log.1.gz: No such file or directory error: error opening /var/log/apache2/myhost/access.log.1.gz: No such file or directory </code> It miss the first one compressed file only and then don't go through to do the next one. I want to know how to compress the first one either. This may help to let it know and continue to run the script.
– jefferyear
Feb 13 '17 at 0:11
If your current data is not important I would recommend starting from scratch. Stop Apache, delete all Apache log files, restart Apache, and let logrotate run normally. Otherwise to compress
access.log.1
just do gzip access.log.1
– Patrick Mevzek
Feb 14 '17 at 0:39
If your current data is not important I would recommend starting from scratch. Stop Apache, delete all Apache log files, restart Apache, and let logrotate run normally. Otherwise to compress
access.log.1
just do gzip access.log.1
– Patrick Mevzek
Feb 14 '17 at 0:39
add a comment |
1 Answer
1
active
oldest
votes
I got fixed.
There are two places modified by my new configuration.
Now, the /var/log/apache2/myhost/ is like below without any alone "access.log.1" and "error.log.1".
What is my configuration on my /etc/logrotate.d as below. I get rid of asterisk and make their name specificlly. Otherwise, I comment "delaycompress" this directive.
/var/log/apache2/myhost/access.log /var/log/apache2/myhost/error.log {
daily
missingok
rotate 2
compress
# delaycompress
# notifempty
create 640 root adm
sharedscripts
postrotate
/etc/init.d/apache2 reload > /dev/null;
endscript
}
Here I add a file /etc/logrotate.conf. I comment out "compress" this also. Then, I execute "sudo logrotate -f /etc/logrotate.d/apache2". This mean to force it to implement this execution. The result is good. Thanks all.
# see "man logrotate" for details
# rotate log files weekly
weekly
# keep 4 weeks worth of backlogs
rotate 4
# create new (empty) log files after rotating old ones
create
# uncomment this if you want your log files compressed
compress
# packages drop log rotation information into this directory
include /etc/logrotate.d
# no packages own wtmp, or btmp -- we'll rotate them here
/var/log/wtmp {
missingok
monthly
create 0664 root utmp
rotate 1
}
/var/log/btmp {
missingok
monthly
create 0660 root utmp
rotate 1
}
# system-specific logs may be configured here
</code>
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
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: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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%2funix.stackexchange.com%2fquestions%2f344405%2flogrotate-error-opening-no-such-file-or-directory%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I got fixed.
There are two places modified by my new configuration.
Now, the /var/log/apache2/myhost/ is like below without any alone "access.log.1" and "error.log.1".
What is my configuration on my /etc/logrotate.d as below. I get rid of asterisk and make their name specificlly. Otherwise, I comment "delaycompress" this directive.
/var/log/apache2/myhost/access.log /var/log/apache2/myhost/error.log {
daily
missingok
rotate 2
compress
# delaycompress
# notifempty
create 640 root adm
sharedscripts
postrotate
/etc/init.d/apache2 reload > /dev/null;
endscript
}
Here I add a file /etc/logrotate.conf. I comment out "compress" this also. Then, I execute "sudo logrotate -f /etc/logrotate.d/apache2". This mean to force it to implement this execution. The result is good. Thanks all.
# see "man logrotate" for details
# rotate log files weekly
weekly
# keep 4 weeks worth of backlogs
rotate 4
# create new (empty) log files after rotating old ones
create
# uncomment this if you want your log files compressed
compress
# packages drop log rotation information into this directory
include /etc/logrotate.d
# no packages own wtmp, or btmp -- we'll rotate them here
/var/log/wtmp {
missingok
monthly
create 0664 root utmp
rotate 1
}
/var/log/btmp {
missingok
monthly
create 0660 root utmp
rotate 1
}
# system-specific logs may be configured here
</code>
add a comment |
I got fixed.
There are two places modified by my new configuration.
Now, the /var/log/apache2/myhost/ is like below without any alone "access.log.1" and "error.log.1".
What is my configuration on my /etc/logrotate.d as below. I get rid of asterisk and make their name specificlly. Otherwise, I comment "delaycompress" this directive.
/var/log/apache2/myhost/access.log /var/log/apache2/myhost/error.log {
daily
missingok
rotate 2
compress
# delaycompress
# notifempty
create 640 root adm
sharedscripts
postrotate
/etc/init.d/apache2 reload > /dev/null;
endscript
}
Here I add a file /etc/logrotate.conf. I comment out "compress" this also. Then, I execute "sudo logrotate -f /etc/logrotate.d/apache2". This mean to force it to implement this execution. The result is good. Thanks all.
# see "man logrotate" for details
# rotate log files weekly
weekly
# keep 4 weeks worth of backlogs
rotate 4
# create new (empty) log files after rotating old ones
create
# uncomment this if you want your log files compressed
compress
# packages drop log rotation information into this directory
include /etc/logrotate.d
# no packages own wtmp, or btmp -- we'll rotate them here
/var/log/wtmp {
missingok
monthly
create 0664 root utmp
rotate 1
}
/var/log/btmp {
missingok
monthly
create 0660 root utmp
rotate 1
}
# system-specific logs may be configured here
</code>
add a comment |
I got fixed.
There are two places modified by my new configuration.
Now, the /var/log/apache2/myhost/ is like below without any alone "access.log.1" and "error.log.1".
What is my configuration on my /etc/logrotate.d as below. I get rid of asterisk and make their name specificlly. Otherwise, I comment "delaycompress" this directive.
/var/log/apache2/myhost/access.log /var/log/apache2/myhost/error.log {
daily
missingok
rotate 2
compress
# delaycompress
# notifempty
create 640 root adm
sharedscripts
postrotate
/etc/init.d/apache2 reload > /dev/null;
endscript
}
Here I add a file /etc/logrotate.conf. I comment out "compress" this also. Then, I execute "sudo logrotate -f /etc/logrotate.d/apache2". This mean to force it to implement this execution. The result is good. Thanks all.
# see "man logrotate" for details
# rotate log files weekly
weekly
# keep 4 weeks worth of backlogs
rotate 4
# create new (empty) log files after rotating old ones
create
# uncomment this if you want your log files compressed
compress
# packages drop log rotation information into this directory
include /etc/logrotate.d
# no packages own wtmp, or btmp -- we'll rotate them here
/var/log/wtmp {
missingok
monthly
create 0664 root utmp
rotate 1
}
/var/log/btmp {
missingok
monthly
create 0660 root utmp
rotate 1
}
# system-specific logs may be configured here
</code>
I got fixed.
There are two places modified by my new configuration.
Now, the /var/log/apache2/myhost/ is like below without any alone "access.log.1" and "error.log.1".
What is my configuration on my /etc/logrotate.d as below. I get rid of asterisk and make their name specificlly. Otherwise, I comment "delaycompress" this directive.
/var/log/apache2/myhost/access.log /var/log/apache2/myhost/error.log {
daily
missingok
rotate 2
compress
# delaycompress
# notifempty
create 640 root adm
sharedscripts
postrotate
/etc/init.d/apache2 reload > /dev/null;
endscript
}
Here I add a file /etc/logrotate.conf. I comment out "compress" this also. Then, I execute "sudo logrotate -f /etc/logrotate.d/apache2". This mean to force it to implement this execution. The result is good. Thanks all.
# see "man logrotate" for details
# rotate log files weekly
weekly
# keep 4 weeks worth of backlogs
rotate 4
# create new (empty) log files after rotating old ones
create
# uncomment this if you want your log files compressed
compress
# packages drop log rotation information into this directory
include /etc/logrotate.d
# no packages own wtmp, or btmp -- we'll rotate them here
/var/log/wtmp {
missingok
monthly
create 0664 root utmp
rotate 1
}
/var/log/btmp {
missingok
monthly
create 0660 root utmp
rotate 1
}
# system-specific logs may be configured here
</code>
answered Feb 15 '17 at 15:32
jefferyear
4819
4819
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%2f344405%2flogrotate-error-opening-no-such-file-or-directory%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
What do you have in
/etc/logrotate.d/httpd-prerotate
? You should probably not do it twice, norapache2 reload
in fact but this is what you are doing because of the two types of logs where in fact they pertain to the same "system" (Apache). Also you seem to miss a '*' it sould be*.log
twice not just.log
. You can also launchlogrotate
with the-d
option to see what it is doing.– Patrick Mevzek
Feb 12 '17 at 15:01
Hi, I mark one of them due to your saying that the /etc/logrotate.d/httpd-prerotate is not existed actually. What do you mean *.log and .log? Here I do not know clearly. I run "logrotate -d apache2" this command. Shows up as below: "removing old log /var/log/apache2/myhost/access.log.1.gz error: error opening /var/log/apache2/myhost/access.log.1.gz: No such file or directory." I check my directory and get list which there are access.log, access.log.1, access.log.2.gz, access.log.3.gz, access.log.4.gz and etc... But, there aren't anyone called as "access.log.1.gz". Is this to make it stop?
– jefferyear
Feb 12 '17 at 16:54
Hi, I got the recent message on my mail box. <code> /etc/cron.daily/logrotate: error: error opening /var/log/apache2/access.log.1.gz: No such file or directory error: error opening /var/log/apache2/myhost/access.log.1.gz: No such file or directory </code> It miss the first one compressed file only and then don't go through to do the next one. I want to know how to compress the first one either. This may help to let it know and continue to run the script.
– jefferyear
Feb 13 '17 at 0:11
If your current data is not important I would recommend starting from scratch. Stop Apache, delete all Apache log files, restart Apache, and let logrotate run normally. Otherwise to compress
access.log.1
just dogzip access.log.1
– Patrick Mevzek
Feb 14 '17 at 0:39