Question of How to Set up a Crontab to Automatically Archive the Reports


#1

Hi,

We installed piwik inside Linux machine, reading the section
http://piwik.org/docs/setup-auto-archiving/
http://piwik.org/docs/setup-auto-archiving/#linuxunix-how-to-set-up-a-crontab-to-automatically-archive-the-reports

“”“
and then add the lines:
MAILTO="youremail@example.com"
5 * * * * www-data /usr/bin/php5 /path/to/piwik/console core:archive --url=http://example.org/piwik/ > /home/example/piwik-archive.log
”""

The log redirection is a simple redirection (overwrite existing logs inside /home/example/piwik-archive.log).
Should not be used the double redirection ">> to not overwrite log files?
Like as:
/usr/bin/php5 /path/to/piwik/console core:archive --url=http://example.org/piwik/ >> /home/example/piwik-archive.log

(Simple redirections)

Regards,
Cesar Jorge


(Matthieu Aubry) #2

It’s good idea to use >> instead of > :+1: - we prefer to leave > in the documentation for now, to not create a “huge” file in case user do not rotate the log