[quote=dep @ May 8 2010, 09:04 AM]Hello,
I’m calling the archive.sh via cronjob.
Since my upgrade from 0.6 RC 1 to 0.6.1 it doesn’t work anymore.
The problem is this call:
$PIWIK_PATH – module=API&method=SitesManager.getAllSitesId&token_auth=$TOKEN_AUTH&format=csv&convertToUnicode=0
It returns an empty csv. (tested it in my browser with correct token id).
I have only one site defined (id=1). I’ve updated piwik by deleting all old files and uploading all
new files via FTP. Everything else (Dashboard, archiving via browser etc.) works fine.
Anyone with the same issue or an idea?[/quote]
I’ve done a little more work on this, and I think I might be on to something.
I inserted the command echo $TOKEN_AUTH into archive.sh just after TOKEN_AUTH=
$CMD_TOKEN_AUTH and the result that I’m seeing is this:
X-Powered-By: PHP/5.2.13^M Set-Cookie: PIWIK_SESSID=b82901c84b2989b34f86fa962a11a03b; path=/^M Expires: Thu, 19 Nov 1981 08:52:00 GMT^M Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0^M Pragma: no-cache^M Content-type: text/html^M ^M <i>token_auth</i>
Where token_auth is the correct code.
I believe that $CMD_TOKEN_AUTH needs to be parsed more to get the actual token_auth code rather than the full returned headers from the command. Thoughts?