Can't set up auto-archiving

Trying to follow this guide:

I’ve customized the archive script but every time I try to run the test I get an authentication error. I assume that the password used relates to the Piwik admin user, so I don’t understand why it constantly fails.

No idea how to keep testing/debugging as the instructions aren’t very thorough.
"www-data is the user that the cron job will be executed by"
Should I be replacing this with my sudo user instead?

Totally lost…

what command exactly did you try to run? and what was returned when running it?

I ran the cron test as in the tutorial:
su www-data -c "/usr/bin/php5 /path/to/piwik/console core:archive --url="

(Modified for my URL of course.)

Was prompted for a password and tried both my piwik password as well as sudo user, but both failed.

Need to have closer look to be sure, but maybe the token_auth works here? You can find it in your accounts settings

Was looking for the setting you mentioned when I saw this “Archive reports when viewed from the browser”

Does this trigger an automatic cleaning of all the binary log files? This was my main concern… that the server was filling up with all this data and that from following various links in the app and documentation I thought we had to manually set up a process to do that. But viewing the stats automatically does this??