Cron


#1

Hello.
I tried to activate the cron to piwik by ssh to my server debian + ispconfig

When I run the test gives me this error:



PHP Warning:  file_put_contents(/var/www/clients/client1/web1/web/statistiche/tmp/climulti/ecc31315356f32aac10f70cc9c251030e4d3332dadc5de26bfa7b7689429e9259a9daca90571a97bd1380c4656a7af1fc90f0.pid): failed to open stream: Permesso negato in /var/www/clients/client1/web1/web/statistiche/core/CliMulti/Process.php on line 140

sh: /var/www/clients/client1/web1/web/statistiche/tmp/climulti/ecc31315356f32aac10f70cc9c251030e4d3332dadc5de26bfa7b7689429e9259a9daca90571a97bd1380c4656a7af1fc90f0.output: Permesso negato

ERROR CoreConsole[2014-11-06 09:03:43] [d0c8a] Got invalid response from API request: http://www.mysite.it/statistiche/index.php?module=API&method=API.getDefaultMetricTranslations&format=original&serialize=1&trigger=archivephp. The response was empty. This usually means a server error. This solution to this error is generally to increase the value of 'memory_limit' in your php.ini file. Please check your Web server Error Log file for more details.

ERROR CoreConsole[2014-11-06 09:03:43] [d0c8a] Got invalid response from API request: http://www.mysite.it/statistiche/index.php?module=API&method=API.getDefaultMetricTranslations&format=original&serialize=1&trigger=archivephp. The response was empty. This usually means a server error. This solution to this error is generally to increase the value of 'memory_limit' in your php.ini file. Please check your Web server Error Log file for more details.

ERROR CoreConsole[2014-11-06 09:03:43] [d0c8a] The Piwik URL http://www.mysite.it/statistiche/index.php does not seem to be pointing to a Piwik server. Response was ''.

ERROR CoreConsole[2014-11-06 09:03:43] [d0c8a] The Piwik URL http://www.mysite.it/statistiche/index.php does not seem to be pointing to a Piwik server. Response was ''.

Report by mail cron daemon:

/bin/sh: /var/www/clients/client1/web1/log/piwik-archive.log: Permission denied

My files /etc/cron.d/piwik-archive


MAILTO="info@mysite.it"
5 * * * * www-data /usr/bin/php5 /var/www/clients/client1/web1/web/statistiche/console core:archive --url=http://www.mysite.it/statistiche/ > /var/www/clients/client1/web1/log/piwik-archive.log

Can you help me?


(Matthieu Aubry) #2

Check that www-data user can write into piwik/tmp/* folder ?


#3

Solved

In /etc/cron.d/piwik-archive I have removed “www-data” in cron code.


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


MAILTO="youremail@example.com"
5 * * * *  /usr/bin/php5 /path/to/piwik/console core:archive --url=http://example.org/piwik/ > /home/example/piwik-archive.log

Seems to work


#4

Check that www-data user can write into piwik/tmp/* folder ?

How can I see / set the permissions to www-data?