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

running goaccess from cron #41

Closed
rukeba opened this issue Oct 2, 2013 · 8 comments
Closed

running goaccess from cron #41

rukeba opened this issue Oct 2, 2013 · 8 comments
Labels

Comments

@rukeba
Copy link

rukeba commented Oct 2, 2013

Looks like goaccess do not see ~/.goaccessrc when running from cron.
I feel it is not goaccess problem, but rather cron.
May be you can help?

Thank you!

@allinurl
Copy link
Owner

allinurl commented Oct 2, 2013

Ruslan, how are you running goaccess from the cron? Also make sure
~/.goaccessrc exists.

On Wed, Oct 2, 2013 at 4:53 PM, Ruslan Keba notifications@github.com wrote:

Looks like goaccess do not see ~/.goaccessrc when running from cron.
I feel it is not goaccess problem, but rather cron.
May be you can help?

Thank you!


Reply to this email directly or view it on GitHub.

@abgit
Copy link
Contributor

abgit commented Oct 3, 2013

@rukeba , make sure you use absolute paths inside cron.
Anyway, if you don't need to export html or csv you shouldn't get any problem.

best,

@rukeba
Copy link
Author

rukeba commented Oct 3, 2013

@allinurl, I am running goaccess from the cron like this:

# cd to $HOME above is present
cat /var/log/nginx/access.***.log.1 | goaccess -a > report.html

The ~/.goaccessrc exists and it contains custom log format (%T added).
When i run goaccess manually, i get report with request times.
When it running from cron i get report without request time.

@rukeba
Copy link
Author

rukeba commented Oct 3, 2013

@abgit thank you! i will check it.

@allinurl
Copy link
Owner

allinurl commented Oct 3, 2013

@rukeba, as @abgit said, check your paths. If running

cat /var/log/nginx/access.***.log.1 | goaccess -a > report.html

shows request times, then running it through the cron should do the same thing.

You can also try using -p to specify the configuration file (v0.6.1).

Let me know how that goes. Thanks!

On Thu, Oct 3, 2013 at 4:54 AM, Ruslan Keba notifications@github.com wrote:

@abgit thank you! i will check it.


Reply to this email directly or view it on GitHub.

@abgit
Copy link
Contributor

abgit commented Oct 4, 2013

@rukeba @allinurl , i have already a goaccess executed inside cron.

Anyway, i have post a issue about a problem when goaccess is used inside sh -c. goaccess tries to automagically detect if output ">" is used in command line based on isatty(). The problem is that isatty() don't detect ">" when goaccess is invoked inside a sh -c as string.

I think it's better to make goaccess export only when defined explicity by command line, eg:
goaccess -f access.log -o html > output.html
goaccess -f access.log -o csv > output.csv
This way, we don't need to goaaccess tries to automagically find if ">" was used or not .. and it will work as expected when invoked inside a linux "find".

best,

@rukeba
Copy link
Author

rukeba commented Oct 4, 2013

Thank you, @allinurl, @abgit for suggestions!

You were right, the issue was in paths.
goaccess 0.5 located in /usr/bin, but newest goaccess 0.6.1 located in /usr/local/bin and by default called 0.5.

I fixed goaccess path to absolute path and explicitly set path to config with -p option.

Now all works like a charm.
Many thanks!

@allinurl
Copy link
Owner

allinurl commented Oct 4, 2013

That's great! Closing this issue.

@allinurl allinurl closed this as completed Oct 4, 2013
@allinurl allinurl added the cron label Jul 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants