Cron help please

Thanks for reading this. I am a bit new to cron jobs and having some trouble getting this to work. I have searched the forum and tried about 15 variations of my cron command with no luck. This is the closest I have gotten.

Command:
/usr/local/bin/php -f /home/myname/public_html/stats/misc/cron/archive.php – url=http://mystite.com/stats/ > /home/myname/public_html/stats/piwik-archive-output.log

Error:
Error in the last Piwik archive.php run:
The Piwik URL http://mysite.com/stats/index.php does not seem to be pointing to a Piwik server. Response was ’

301 Moved Permanently

Moved Permanently

The document has moved here.


Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/1.0.0-fips mod_bwlimited/1.4 Server at mysite.com Port 80 '.

Here is the full errors output:

NOTE: if you execute this script at least once per hour (or more often) in a crontab, you may disable ‘Browser trigger archiving’ in Piwik UI > Settings > General Settings.
see doc at: How to Set up Auto-Archiving of Your Reports - Analytics Platform - Matomo

INIT
Querying Piwik API at: http://mysite.com/stats/index.php
Running as Super User: mypikwiksuperusername
ERROR: The Piwik URL http://mysite.com/stats/index.php does not seem to be pointing to a Piwik server. Response was ’

301 Moved Permanently

Moved Permanently

The document has moved here.


Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/1.0.0-fips mod_bwlimited/1.4 Server at mysite.com Port 80 '. PHP Fatal error: The Piwik URL http://mysite.com/stats/index.php does not seem to be pointing to a Piwik server. Response was ' 301 Moved Permanently

Moved Permanently

The document has moved here.


Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/1.0.0-fips mod_bwlimited/1.4 Server at mysite.com Port 80 '. in /home/myname/public_html/stats/misc/cron/archive.php on line 555

Thank you for any help you can give.

The URL you set in the cron: http://mystite.com/stats/

is not correct, the server says it is a redirect. Load it in your brwoser, you will notice the redirect. Then put the final URL in the cron script. Maybe for example you forgot to put the www. ?

You were correct. Many thanks for the help.
Now working on the “SQLSTATE[HY000]: General error: 2006 MySQL server has gone away” that you addressed at this link.
http://forum.piwik.org/read.php?2,91537,91537
Thanks again.