Skip to content
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

Closed
wants to merge 1 commit into from
Closed

logrotate documentation for Ubuntu #91

wants to merge 1 commit into from

Conversation

da2x
Copy link
Contributor

@da2x da2x commented Jul 27, 2013

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

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.)
Copy link
Contributor Author

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)

Copy link
Member

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?

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 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.)

can you explain where dateext should be used? what format does not match?


Reply to this email directly or view it on GitHub.

@da2x
Copy link
Contributor Author

da2x commented Jul 31, 2013

@mattab, dateext should be added on a new line after daily. The format of the logfiles will be access.log-YYYYMMDD.gz. The compression part of the name can be delayed by one rotation. Meaning the .gz extension is not guaranteed.

@mattab
Copy link
Member

mattab commented Jul 31, 2013

should I merge your PR as is (is it correct?) or would you like to mention this somehow in the readme?

@halfdan
Copy link
Member

halfdan commented Aug 24, 2013

Any update?

@mattab
Copy link
Member

mattab commented Sep 6, 2013

Ping us to reopen PR, cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants