New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
logrotate documentation for Ubuntu #91
Conversation
Shell script is used because logrotate runs through sh. More easily tested and maintained from a separate script and harder to run into parsing problems too. Output directed to /dev/null
0 1 * * * /path/to/piwik/misc/log-analytics/import-logs.py -u piwik.example.com `date --date=yesterday +/var/log/apache/access-\%Y-\%m-\%d.log` | ||
0 1 * * * /path/to/your_script.sh > /dev/null | ||
|
||
For Apache on Debian/Ubuntu, you should call your script from logrotate directly instead. Change the keyword `weekly` to `daily` in `/etc/logrotate.d/apache2`. Then add `/path/to/your_script.sh > /dev/null` in the `postrotate` section (on the line immediately after apache configuration is reloaded.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if I should explicitly say you should add the dateext
option. The format does not match that of the sample shell script anyway. (logrotate’s default is: whatever.log-YYYYMMDD)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you explain where dateext should be used? what format does not match?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to show daily visitor numbers on graph. I have to take this numbers from url via json. Then I must show it daily in graph.Thank you in advance.
Date: Mon, 29 Jul 2013 09:43:16 -0700
From: notifications@github.com
To: piwik@noreply.github.com
Subject: Re: [piwik] logrotate documentation for Ubuntu (#91)
In misc/log-analytics/README.md:
You can then import your logs automatically each day (at 0:01). Setup a cron job with the command:
- 0 1 * * * /path/to/piwik/misc/log-analytics/import-logs.py -u piwik.example.com
date --date=yesterday +/var/log/apache/access-\%Y-\%m-\%d.log
- 0 1 * * * /path/to/your_script.sh > /dev/null
+For Apache on Debian/Ubuntu, you should call your script from logrotate directly instead. Change the keyword
weekly
todaily
in/etc/logrotate.d/apache2
. Then add/path/to/your_script.sh > /dev/null
in thepostrotate
section (on the line immediately after apache configuration is reloaded.)
can you explain where dateext should be used? what format does not match?
—
Reply to this email directly or view it on GitHub.
@mattab, |
should I merge your PR as is (is it correct?) or would you like to mention this somehow in the readme? |
Any update? |
Ping us to reopen PR, cheers! |
Shell script is used because logrotate runs through sh. More easily tested and maintained from a separate script and harder to run into parsing problems too.
Output directed to /dev/null