Questions tagged [logrotate]
74 questions
101
votes
3 answers
logrotate configuration file syntax - multiple wildcard entries possible?
Since the man page doesn't answer my question and I don't want to force a rotation cycle, I decided to ask the question here.
The man page for logrotate gives the following example:
"/var/log/httpd/access.log" /var/log/httpd/error.log {
…
0xC0000022L
- 6,819
- 10
- 50
- 82
74
votes
11 answers
Log rotation of stdout?
I have a Linux program which can write information to stdout and stderr.
I have a shell script which redirects that output to a file in /var/log. (Via >> and 2>&1.)
Is there a way to make that log file rotate? (max size, then switch to a different…
Miral
- 1,189
- 1
- 9
- 12
25
votes
1 answer
How to logrotate with systemd?
I'm running a node app using systemd with a unit file. The apps log can be viewed using journalctl -u example.com but the log gets cut at some point, erasing the history (which I need for debugging).
How do I configure log rotation with systemd so…
htor
- 353
- 1
- 3
- 6
18
votes
2 answers
Logrotate no longer reads symlinked configuration file due to non-root ownership
We are currently upgrading from Ubuntu 12.04 LTS to 14.04 LTS on our ruby on rails application servers, and have noticed that the log files are no longer rotating.
On both machines we have a file /var/app-name/config/logrotate owned by our unix user…
phantomwhale
- 231
- 2
- 6
12
votes
4 answers
logrotate unable to rotate logs, getting "No such file error"
logrotate is unable to rotate my logs. I have checked the file permissions, they are fine.
I have even tried by putting "su root root" in the configuration file, still I am facing the same issue.
Please find the relevant details…
Sandeep Singh
- 1,582
- 2
- 11
- 10
5
votes
2 answers
Will cron.daily wait for jobs to finish before starting the next one?
This page http://wiki.ci.uchicago.edu/I2U2/WebalizerConfiguration
suggests renaming /etc/cron.daily/logrotate so it comes after /etc/cron.daily/webalizer - webalizer should be done before logrotate kicks in.
Is that true ? Will cron.daily wait for…
commonpike
- 343
- 3
- 11
5
votes
1 answer
LogRotate use regex for filename
I have a custom logging class that creates a log for each instance of the process and adds a unique id to the log file name, example:
process.1234.log
process.1235.log
Also I can add a date/time stamp as well,…
Phill Pafford
- 245
- 2
- 4
- 12
4
votes
2 answers
How to rotate enumerated filenames similar to logrotate?
I have a couple of files, let's say map-0.jpg (newest), map-1.jpg, map-2.jpg, ..., map-9.jpg (oldest). Now my cronjob downloads a new picture from the internet and should save it as map-0.jpg. All other files, however, should be newly enumerated (0…
André
- 43
- 1
- 3
4
votes
1 answer
logrotate configuration and execution
I'm trying to configure logrotate to rotate and delete log files every day at midnight, but have never used it before. So: (a) I want to confirm that my configuration is correct, and (b) I need help getting on automating its daily execution at…
pnongrata
- 2,782
- 17
- 51
- 82
3
votes
1 answer
logrotate: How to configure and override defaults?
I'm testing a logrotate configuration in /tmp. I'd like
to configure a default logrotate policy for /tmp/*.log files using my test configuration file /tmp/logrotate.conf
to handle a particular log file /tmp/special.log with a different policy…
user1011471
- 165
- 1
- 7
3
votes
2 answers
Merge and view rotated and compressed logfiles
I have a bunch of partly compressed rotated logfiles from a Glassfish application server (using a custom Java logging format):
/tmp/server.log /tmp/server.log.13.gz /tmp/server.log.18.gz /tmp/server.log.23.gz /tmp/server.log.28.gz …
Wolkenarchitekt
- 823
- 1
- 9
- 17
3
votes
1 answer
Logrotate olddir with date
it's possible to configure logrotate to create an olddir per day?
I'd like to get the same bash result, like this:
user@blade1022m:~$ date "+%y%m%d"
120208
In /etc/logrotate.conf (pseudo-code):
/home/mhd-01/logs/*.log {
daily
missingok
rotate…
Fabio
- 31
- 1
- 3
3
votes
4 answers
Logrotate Error: Unable to open ... for compression
When using logrotate from a cronjob, I am getting this erros:
error: unable to open /var/log/mylog.1 for compression
Does any one know what does it mean and how can I fix it ?
gkof
3
votes
1 answer
Why logrotate maxsize condition is not working?
I've specific problem with logrotate which is rotating before reaches the limit - set by maxsize
logrotate version - 3.8.6
I've a custom logrotate file
/var/web/log/access_log
{
rotate 40
maxsize 200M
missingok
compress
}
and…
Geo Fery
- 33
- 1
- 4
3
votes
1 answer
Logrotate - can I configure multiple services in one configuration file?
I am planning some infrastructural architecture. It seems as if logrotate configuration files in /etc/logrotate.d usually handle exactly one type of log rotation.
My question: Would it be possible to create a file like /etc/logrotate.d/my_company,…
hey
- 146
- 1
- 8