Jump to content

UNIX CronTab Specification


iwato
 Share

Recommended Posts

GREETING:  I would like to wish everyone at W3Schools a very Happy New Year!

BACKGROUND:  In an effort to speed up Matomo's performance without having to create a routine that will retrieve, save, and call the desire data -- a procedure suggested earlier by others --  I am seeking to set up a Matomo CRON job that apparently does the same with no additional coding on my part.  Unfortunately, I am confused by the syntax.

CODE (RECOMMENDED BY MATOMO):

5 * * * * www-data /usr/bin/php5 /path/to/piwik/console core:archive --url=http://example.org/piwik/ > /home/example/piwik-archive.log

QUESTION:  To what refers the phrase core:archive in the above code segment?

NOTE:  Within the path/to/piwik folder there exists a document file called console.  Within the path/to/piwik/core folder there exists a file called Console.php, a folder called Archive, and a file called Archive.php.  There are various files in the Archive folder, but none of them resemble very closely any of the folders and files just mentioned.

Roddy

Edited by iwato
Link to comment
Share on other sites

Hi Roddy,

Here's what I can piece together from the help file. (If I'm not mistaken, it may be the one you are referring to)

https://matomo.org/docs/setup-auto-archiving/

 

`core:archive` is the command being run, much like 'mkdir' or 'cat' in other command lines. I am unsure of whether the command is in two parts and parsed together (archive command of core module) or otherwise. At the bottom of the page, you can see the help output of the command.

  • Like 1
Link to comment
Share on other sites

Yes, your link is the same that caused me to ask the question.  I will explore a little further with the idea of looking for a command.

Thank you for responding.

Roddy

Link to comment
Share on other sites

Those are just parameters that get passed to the console application.  When the shell executes the console application, it passes all of the command-line parameters to it.  One parameter will be "core:archive" and the other will be the --url parameter.  It will also have the entire command available.  Look up argv and argc in C for a general description about how that works.

https://developer.matomo.org/guides/piwik-on-the-command-line

  • Thanks 1
Link to comment
Share on other sites

Thank you, JSG.  I do not know a thing about C, let alone the argv and argc parameter.  This said, I can well imagine.

No, no, no.  I am not eager to learn still another computing language!  I am having enough trouble with the ones, that I have already attempted.  It has never been my goal to become an online developer.  It just sort of happened out of curiosity and in self-defense.

Roddy

p.s. Great Link!

Edited by iwato
Link to comment
Share on other sites

I wasn't suggesting learning C, but if you want to understand what happens when you run a program on the command line, looking that up will help you understand that.  On a command line you type the name of the application to run, and then whatever options or parameters you want to send, and the application will have access to those.  That's all you're seeing in the command there.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...