Conflicting Files ? ? Pending

User tests: Successful: Unsuccessful:

avatar alikon
alikon
27 May 2019

porting #22310 to 4.x

Goal

a way to run scheduled "quick" tasks in approximately regular intervals

Summary of Changes

  • a new system plugin scheduler
  • two new console command

How it works

In a normal hosting situation that would be job for cron, but if your hosting doesn’t offer cron, then a common solution in these cases is “poor man’s cron:” on every page load (onAfterRespond) the scheduler system plugin check if itself is expected to run and then trigger a new event onExecuteScheduledTask then any job plugin wich listen to that event check if itself is expected to run and if so execute his task.

Testing Instructions (web)

  • apply PR
  • System panel -> discover -> you'll find a new system plugin scheduler
  • install it
  • set options, publish the plugin and save
    for test only
    Frequency (in minutes) set = 0 mean run every (onAfterRespond)

Screenshot from 2019-05-28 18-55-57

  • install these 2 silly job plugin:
    plg_job_one.zip
    plg_job_two.zip

  • job one simply sleep for 1 seconds

  • job two simply sleep for 3 seconds

  • set options, publish the plugin and save plugin ONE
    Frequency (in unit) set 1
    Unit of time set minute

means that this plugin run 1xminute = every minute
if onExecuteScheduledTask has been triggered

Screenshot from 2019-05-30 18-55-18

  • set options, publish the plugin and save plugin TWO
    maybe use different settings than ONE

Expected result

depending on your (plugins) settings
take a coffe/smoke/whatever ?
randomly click a couple of frontend pages
check the log file at yoursite/administrator/logs/joomla_web.php
you'll see something like this

#
#<?php die('Forbidden.'); ?>
#Date: 2019-05-30 17:24:39 UTC
#Software: Joomla! 4.0.0-alpha10-dev Development [ Amani ] 16-May-2019 19:22 GMT

#Fields: datetime	priority clientip	category	message
2019-05-30T17:24:39+00:00	INFO 127.0.0.1	scheduler	Scheduler>start
2019-05-30T17:24:40+00:00	INFO 127.0.0.1	scheduler	Job>jobone Task#221 Processing Time: 1.01 seconds.
2019-05-30T17:24:43+00:00	INFO 127.0.0.1	scheduler	Job>jobtwo Task#166 Processing Time: 3.01 seconds.
2019-05-30T17:24:43+00:00	INFO 127.0.0.1	scheduler	Scheduler>stop>task#1564 Total Processing Time: 4.04 seconds.
2019-05-30T17:24:47+00:00	INFO 127.0.0.1	scheduler	Scheduler>start
2019-05-30T17:24:47+00:00	INFO 127.0.0.1	scheduler	Scheduler>stop>task#1565 Total Processing Time: 0.04 seconds.

1st run
the scheduler plugin (wich runs always frequency=0) trigger the onExecuteScheduledTask event
so plugin ONE and plugin TWO are executed (cause no previous run)

2nd run
the scheduler plugin (wich runs always frequency=0) trigger the onExecuteScheduledTask event
but this time both plugin have an expected scheduled time (for example ONE each 1min TWO each 5min)
the 2nd run was at 17:24:47+00:00
the 1st run was at 17:24:43+00:00
they have only 4 seconds of difference form the previous execution so both plugin are not expected to run

3rd run
it depends on how fast you click & settings

Testing Instructions (webcron)

on scheduler system plugin
set Webcron to yes/enable
set Key to mywebcronactivationkey
then use yoursiteurl/index.php?webcronkey=mywebcronactivationkey as the url for webcron services to be triggred

Testing Instructions (cli/cron)

Go to the cli folder of your website and run
php joomla.php job:run
Screenshot from 2019-05-30 20-03-51

check the log file at yoursite/administrator/logs/joomla_cli.php

Actual result

N/A

Additional comments

it can be used for tasks like:

  • deleteExpiredConsents
  • remindExpiringConsents
  • logRotation
  • updateNotifications
  • sessionGC
  • etc...

Documentation Changes Required

yes

Votes

# of Users Experiencing Issue
0/1
Average Importance Score
5.00

avatar alikon alikon - open - 27 May 2019
avatar alikon alikon - change - 27 May 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 27 May 2019
Category Administration Language & Strings Libraries Front End Plugins
avatar brianteeman
brianteeman - comment - 27 May 2019

Thanks very much for this PR

4a156f8 27 May 2019 avatar alikon cs
avatar alikon alikon - change - 27 May 2019
Labels Added: ? ?
f3998ea 27 May 2019 avatar alikon cs
9f8c49e 28 May 2019 avatar alikon cs
9ca974d 28 May 2019 avatar alikon cs
197eb67 28 May 2019 avatar alikon cs
88da1ad 28 May 2019 avatar alikon cs
4d0589f 28 May 2019 avatar alikon cs
avatar franz-wohlkoenig franz-wohlkoenig - change - 28 May 2019
Title
[4.0][wip] poor cron
[4.0] [wip] poor cron
avatar franz-wohlkoenig franz-wohlkoenig - edited - 28 May 2019
avatar alikon alikon - change - 28 May 2019
The description was changed
avatar alikon alikon - edited - 28 May 2019
avatar alikon alikon - change - 28 May 2019
The description was changed
avatar alikon alikon - edited - 28 May 2019
avatar alikon alikon - change - 29 May 2019
The description was changed
avatar alikon alikon - edited - 29 May 2019
avatar alikon alikon - change - 30 May 2019
The description was changed
avatar alikon alikon - edited - 30 May 2019
avatar alikon alikon - change - 30 May 2019
The description was changed
avatar alikon alikon - edited - 30 May 2019
avatar alikon alikon - change - 30 May 2019
Title
[4.0] [wip] poor cron
[4.0] poor man’s cron
avatar alikon alikon - edited - 30 May 2019
avatar richard67
richard67 - comment - 16 Jul 2019

@alikon Do you plan to add the SQL for inserting the new system plugin into the #__extensions table to joomla.sql scripts and add schema updates for the same thing?

avatar alikon
alikon - comment - 17 Jul 2019

yes, if i only got some feedback before....it seems lack of interest as for now

avatar f-hamel
f-hamel - comment - 26 Jul 2019

Hey. This is a great PR and something people at managed and shared hosting provider need.
Trust me I know working for year at web hosting company. Most of them just give them an interface to create something like pseudo cronjobs. And on the other hand most users are not familiar with managing a server and cronjobs. So this would be a nice addon to help them.

And I really want to test this, but at the moment it's not possible because the Commands compatible with the Joomla\Console\Command\AbstractCommand::configure().

I guess at least the return type declaration is missing.

protected function configure()

This should be look like this:

	protected function configure(): void
avatar joomla-cms-bot joomla-cms-bot - change - 27 Jul 2019
Category Administration Language & Strings Libraries Front End Plugins Administration Language & Strings SQL Installation Libraries Front End Plugins
avatar joomla-cms-bot joomla-cms-bot - change - 27 Jul 2019
Category Administration Language & Strings Libraries Front End Plugins SQL Installation SQL Administration com_admin Language & Strings Installation Libraries Front End Plugins
avatar joomla-cms-bot joomla-cms-bot - change - 27 Jul 2019
Category Administration Language & Strings Libraries Front End Plugins SQL Installation com_admin SQL Administration com_admin Postgresql Language & Strings Installation Libraries Front End Plugins
avatar alikon
alikon - comment - 27 Jul 2019

@f-hamel should be ready for test
@richard67 sql added

avatar f-hamel
f-hamel - comment - 29 Jul 2019

At the Moment. The CLI seems to be broken by this PR.

php joomla.php list
cli 4.0.0-alpha11-dev

Usage:
  command [options] [arguments]

Options:
  -h, --help            Display the help information
  -q, --quiet           Flag indicating that all output should be silenced
      --ansi            Force ANSI output
      --no-ansi         Disable ANSI output
  -n, --no-interaction  Flag to disable interacting with the user
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

The command list is missing.

Also

php joomla.php job:run

returns nothing at the moment on console. So there is no output.
I don't know if there is maybe any php or mysql error. Because my error reporting is broken at the moment. Maybe some else who test this will have more information or will test this successful.

avatar alikon
alikon - comment - 2 Aug 2019

ok, you are right the CLI part needs some more refactoring. meanwhile, can we test the no-CLI side ?

avatar alikon
alikon - comment - 21 Aug 2019

@f-hamel previous reported issues fixed, can you retest ?

avatar bees4ever bees4ever - test_item - 3 Sep 2019 - Tested successfully
avatar bees4ever
bees4ever - comment - 3 Sep 2019

I have tested this item successfully on 4d0589f

It is a very great and usefull PR. It worked for me, but I noticed two things, what I want to ask here.

I installed the schedule and the two job plugins. Where plugin one runs every 10 minute and the second one every second minute. When I change some settings in the scheduler, the job queue is kind of resetted, so that both jobs starts again, even if there was some minute to the 10 minute waiting time of job one. But I think this is known and ok.

Then I tested the web cron trigger url. It worked as expected, so that the onExecuteScheduledTask is triggered the same as the web page reload. But maybe something is wrong, because if I open / curl this link index.php?webcronkey=mywebcronactivationkey just the home page is loaded, it doesnt matter if the key is right or not, of course it is working, but I am not sure if this is expected.

I hope @alikon understand my explaination ?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25022.

avatar alikon
alikon - comment - 8 Sep 2019

thanks for testing

when the webcron option is setted if the activation key is wrong the scheduled job's are not executed, even if the page is rendered

when you change scheduler or job settings this could affect the next job execution time
there is an hidden param that holds the last run time so the next run is expected based to that last rum time + the new setting

avatar jaydevingawale jaydevingawale - test_item - 19 Oct 2019 - Tested successfully
avatar jaydevingawale
jaydevingawale - comment - 19 Oct 2019

I have tested this item successfully on 4d0589f

I have tested this and its working perfectly, it only created the log file to mysite/logs/joomla_web.php


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25022.

avatar jaydevingawale jaydevingawale - test_item - 19 Oct 2019 - Tested successfully
avatar jaydevingawale
jaydevingawale - comment - 19 Oct 2019

I have tested this item successfully on 4d0589f

I have tested this and its working perfectly, it only created the log file to mysite/logs/joomla_web.php


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25022.

avatar ladyjer
ladyjer - comment - 19 Oct 2019

Hi, I've tested "php joomla.php job:run" without success.
I get this console error:

ladyj@jarvis:~/Area51/Projects/Web/area51.ladyj.eu/joomla-cms-4/cli$ php joomla.php job:run
PHP Fatal error:  Uncaught TypeError: Argument 1 passed to Symfony\Component\Debug\ExceptionHandler::handle() must be an instance of  Exception, instance of ParseError given in /home/ladyj/Area51/Projects/Web/area51.ladyj.eu/joomla-cms-4/libraries/vendor/symfony/debug/ExceptionHandler.php:118
Stack trace:
#0 [internal function]: Symfony\Component\Debug\ExceptionHandler->handle(Object(ParseError))
#1 {main}
thrown in /home/ladyj/Area51/Projects/Web/area51.ladyj.eu/joomla-cms-4/libraries/vendor/symfony/debug/ExceptionHandler.php on line 118

I get the same error with: "php joomla.php database:export".

ladyj@jarvis:~/Area51/Projects/Web/area51.ladyj.eu/joomla-cms-4/cli$ php joomla.php database:export
PHP Fatal error:  Uncaught TypeError: Argument 1 passed to Symfony\Component\Debug\ExceptionHandler::handle() must be an instance of Exception, instance of ParseError given in /home/ladyj/Area51/Projects/Web/area51.ladyj.eu/joomla-cms-4/libraries/vendor/symfony/debug/ExceptionHandler.php:118
Stack trace:
#0 [internal function]: Symfony\Component\Debug\ExceptionHandler->handle(Object(ParseError))
#1 {main}
thrown in /home/ladyj/Area51/Projects/Web/area51.ladyj.eu/joomla-cms-4/libraries/vendor/symfony/debug/ExceptionHandler.php on line 118

@mbabker could it be due to something wrong on my environment?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25022.
avatar webfeuerflo webfeuerflo - test_item - 19 Oct 2019 - Tested successfully
avatar webfeuerflo
webfeuerflo - comment - 19 Oct 2019

I have tested this item successfully on 4d0589f

the two provdided test jobs are running. Missing language strings in job2 plugin for minutes and hours


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25022.

avatar alikon
alikon - comment - 22 Oct 2019

@ladyjer there was a silly error in the opening of the comment #25022 (review) fixed by 099c26b
so nothing wrong with your environment
the CLI side is ready to be tested....

avatar alikon alikon - change - 30 Jan 2020
Labels Added: ?
avatar richard67
richard67 - comment - 1 Feb 2020

@alikon I've just created updated versions of your 2 test plugins so they use language file names without the "en-GB." at the beginning, like we do it in core now. You can find them here:

Please download and check and if ok, either replace your downloads by these or change the links in your testing instructions so they point to my links.

avatar richard67
richard67 - comment - 2 Feb 2020

@alikon Beside the language ("runned") and variable name I've mentioned in my previous review I've found following when testing CLI:
test-poor-mans-cron_1

I.e. "job:list" works well, "job:run" works too but shows the PHP notice (same notice 2 times) about Undefined index: REMOTE_ADDR in /libraries/vendor/joomla/utilities/src/IpHelper.php on line 488. Am trying to find reason, but maybe @SharkyKZ has an idea?

Update: Could that be related to webserver settings? It seems not to be related to this PR, I think. But at the other hand it makes the log fail, i.e. when running with CLI there is nothing in the logfile joomla_web.php for these runs.

avatar richard67
richard67 - comment - 2 Feb 2020

@alikon Another thing I just see is that the scheduler plugin still uses old style language file names starting with "en-GB.". Should I make a PR for your branch so you can apply all my suggested changes from review plus the language file name change with one click?

avatar richard67
richard67 - comment - 2 Feb 2020

@alikon Made alikon#64 to save you some work. Contains all changes in my above reviews, too.

avatar richard67
richard67 - comment - 2 Feb 2020

The PHP notice on CLI mentioned in one of my comments above seems really to be an error in the IpHelper. It doesn't check if the array key 'REMOTE_ADDR' exists before checking it in line 488. So this seems not to be a mistake in this PR here.

avatar SharkyKZ
SharkyKZ - comment - 2 Feb 2020

IMO, changes do not belong in Joomla\CMS\Plugin\PluginHelper.

avatar richard67
richard67 - comment - 2 Feb 2020

@SharkyKZ Which ones you mean? The "1918" to "1970" date correction I've suggested above? If you mean that, let me know where else to change them. Or do you mean the PHP notice in CLI? This should already be solved in the utilities package with your PR joomla-framework/utilities#23, I have to check if it has been merged into the 2.0-dev branch there. If so, we maybe just have to update the utilities package in the cms.

Update: The "1918" date correction I've suggested above changes something which will be added to the plugin helper class by this PR here. So if it is wrong to add something there then this PR does it wrong (what I don't believe right now).

Update 2: I just saw the changes in joomla-framework/utilities#23 haven't been merged up yet to the 2.0-dev branch of the utilities package.

avatar SharkyKZ
SharkyKZ - comment - 2 Feb 2020

I mean any code added to PluginHelper class. At least currently the code is called only by Scheduler plugin so it's more suitable for the code to be contained in the plugin. But I'm not sure what the intention here is.

avatar SharkyKZ
SharkyKZ - comment - 2 Feb 2020

I'm also not sure how correct is the use of checked_out_time property here.

avatar richard67
richard67 - comment - 2 Feb 2020

@SharkyKZ Well I can't say if it's right to add code there or not, but that was then done by this PR and not by my suggested changes. Regarding the "abuse" of the checked out time column: Yes, I agree, it looks a bit like a hack to me. But I could live with that.

avatar richard67 richard67 - change - 2 Feb 2020
The description was changed
avatar joomla-cms-bot joomla-cms-bot - edited - 2 Feb 2020
avatar richard67
richard67 - comment - 2 Feb 2020

Corrected path to logs folder in description.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25022.

avatar richard67
richard67 - comment - 2 Feb 2020

Corrected path to logs folder.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25022.

avatar richard67
richard67 - comment - 2 Feb 2020

@alikon So, now I've tested again, and it works for me as described (web, webcron and cli).

What remains to be clarified is the architectural question raised by @SharkyKZ if the PluginHelper class is the right place to add the new stuff, and his and my concern if the usage of the checked_out_time column is suitable for that. For me it works and I'm ok with it, but maybe it can be improved.

I'll wait for some info before I mark my test result with success. Maybe there will be some changes. Just ping me when all is ok or when I shall test again. Now that I know how it works I can do it more quickly.

avatar alikon
alikon - comment - 2 Feb 2020

i'm open to hear all the feedback, and i'm really happy that we have some feedback now

  • for the checked_out_time column usage

yes it seems like an hack, but my goal was that, i didn't want to add another column,
i've written this for j3 and then ported on j4 cause it was too late for j3

  • for the PluginHelper code

i'm open to listen a better way to do it

avatar richard67
richard67 - comment - 4 Feb 2020

@alikon The clean solution would be to create a new class for the new function, if necessary a child class of the plugin helper (@SharkyKZ what do you think?) and to create a new table for the jobs.

@wilsonge Any suggestions?

avatar alikon alikon - change - 12 Feb 2020
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2020-02-12 19:36:53
Closed_By alikon
avatar alikon alikon - close - 12 Feb 2020
avatar alikon
alikon - comment - 13 Feb 2020

let's give this a nth attempt

avatar alikon alikon - change - 13 Feb 2020
Status Closed New
Closed_Date 2020-02-12 19:36:53
Closed_By alikon
avatar alikon alikon - change - 13 Feb 2020
Status New Pending
avatar alikon alikon - reopen - 13 Feb 2020
avatar astridx
astridx - comment - 14 Feb 2020

I have tested this:

  1. git fetch origin pull/25022/head:patch-81
  2. git checkout patch-81
  3. New installation because of database changes
  4. npm ci is not needed but I did it
  5. System panel -> discover -> I found no new system plugin scheduler, but I realize, that it is installed :)

Plugins  System   Job Scheduler   admin   Administration

Plugins   admin   Administration

Testing web

  1. I set the options

  2. I installed the two jobs via System extension Upload package and enabled them.

Extensions  Install   admin   Administration

Plugins   admin   Administration(1)

  1. I set the options (In job2 are not language strings but this is not part of this pr)

  2. i wait a short time and see this output in the log file.

#
#<?php die('Forbidden.'); ?>
#Date: 2020-02-14 13:45:14 UTC
#Software: Joomla! 4.0.0-beta1-dev Development [ Mañana ] 17-October-2019 20:21 GMT

#Fields: datetime	priority clientip	category	message
2020-02-14T13:45:14+00:00	INFO 127.0.0.1	scheduler	Scheduler>start
2020-02-14T13:45:14+00:00	INFO 127.0.0.1	scheduler	Scheduler>stop>task#1 Total Processing Time: 0.01 seconds.
2020-02-14T13:45:48+00:00	INFO 127.0.0.1	scheduler	Scheduler>start
2020-02-14T13:45:48+00:00	INFO 127.0.0.1	scheduler	Scheduler>stop>task#1 Total Processing Time: 0.01 seconds.
2020-02-14T13:47:43+00:00	INFO 127.0.0.1	scheduler	Scheduler>start
2020-02-14T13:47:43+00:00	INFO 127.0.0.1	scheduler	Scheduler>stop>task#2 Total Processing Time: 0.01 seconds.
2020-02-14T13:48:18+00:00	INFO 127.0.0.1	scheduler	Scheduler>start
2020-02-14T13:48:18+00:00	INFO 127.0.0.1	scheduler	Scheduler>stop>task#3 Total Processing Time: 0.01 seconds.
2020-02-14T13:48:19+00:00	INFO 127.0.0.1	scheduler	Scheduler>start
2020-02-14T13:48:19+00:00	INFO 127.0.0.1	scheduler	Scheduler>stop>task#4 Total Processing Time: 0.02 seconds.
2020-02-14T13:48:19+00:00	INFO 127.0.0.1	scheduler	Scheduler>start
2020-02-14T13:48:19+00:00	INFO 127.0.0.1	scheduler	Scheduler>stop>task#5 Total Processing Time: 0.02 seconds.
2020-02-14T13:48:19+00:00	INFO 127.0.0.1	scheduler	Scheduler>start
2020-02-14T13:48:19+00:00	INFO 127.0.0.1	scheduler	Scheduler>stop>task#6 Total Processing Time: 0.01 seconds.
2020-02-14T13:48:19+00:00	INFO 127.0.0.1	scheduler	Scheduler>start
2020-02-14T13:48:19+00:00	INFO 127.0.0.1	scheduler	Scheduler>stop>task#7 Total Processing Time: 0.03 seconds.
2020-02-14T13:48:19+00:00	INFO 127.0.0.1	scheduler	Scheduler>start
2020-02-14T13:48:19+00:00	INFO 127.0.0.1	scheduler	Scheduler>stop>task#8 Total Processing Time: 0.02 seconds.
2020-02-14T13:48:19+00:00	INFO 127.0.0.1	scheduler	Scheduler>start
2020-02-14T13:48:19+00:00	INFO 127.0.0.1	scheduler	Scheduler>stop>task#9 Total Processing Time: 0.01 seconds.
2020-02-14T13:48:24+00:00	INFO 127.0.0.1	scheduler	Scheduler>start
2020-02-14T13:48:24+00:00	INFO 127.0.0.1	scheduler	Scheduler>stop>task#10 Total Processing Time: 0.01 seconds.
2020-02-14T13:48:32+00:00	INFO 127.0.0.1	scheduler	Scheduler>start
2020-02-14T13:48:32+00:00	INFO 127.0.0.1	scheduler	Scheduler>stop>task#11 Total Processing Time: 0.01 seconds.
2020-02-14T13:48:32+00:00	INFO 127.0.0.1	scheduler	Scheduler>start
2020-02-14T13:48:32+00:00	INFO 127.0.0.1	scheduler	Scheduler>stop>task#12 Total Processing Time: 0.01 seconds.
2020-02-14T13:48:32+00:00	INFO 127.0.0.1	scheduler	Scheduler>start
2020-02-14T13:48:32+00:00	INFO 127.0.0.1	scheduler	Scheduler>start
2020-02-14T13:48:32+00:00	INFO 127.0.0.1	scheduler	Scheduler>stop>task#13 Total Processing Time: 0.02 seconds.
2020-02-14T13:48:32+00:00	INFO 127.0.0.1	scheduler	Scheduler>stop>task#14 Total Processing Time: 0.02 seconds.
2020-02-14T13:48:32+00:00	INFO 127.0.0.1	scheduler	Scheduler>start
2020-02-14T13:48:32+00:00	INFO 127.0.0.1	scheduler	Scheduler>stop>task#15 Total Processing Time: 0.02 seconds.
2020-02-14T13:48:32+00:00	INFO 127.0.0.1	scheduler	Scheduler>start
2020-02-14T13:48:32+00:00	INFO 127.0.0.1	scheduler	Scheduler>stop>task#16 Total Processing Time: 0.01 seconds.
2020-02-14T13:48:32+00:00	INFO 127.0.0.1	scheduler	Scheduler>start
2020-02-14T13:48:32+00:00	INFO 127.0.0.1	scheduler	Scheduler>stop>task#17 Total Processing Time: 0.02 seconds.
2020-02-14T13:48:34+00:00	INFO 127.0.0.1	scheduler	Scheduler>start
2020-02-14T13:48:34+00:00	INFO 127.0.0.1	scheduler	Scheduler>stop>task#18 Total Processing Time: 0.01 seconds.
2020-02-14T13:49:02+00:00	INFO 127.0.0.1	scheduler	Scheduler>start
2020-02-14T13:49:02+00:00	INFO 127.0.0.1	scheduler	Scheduler>stop>task#19 Total Processing Time: 0.01 seconds.
2020-02-14T13:49:10+00:00	INFO 127.0.0.1	scheduler	Scheduler>start
2020-02-14T13:49:10+00:00	INFO 127.0.0.1	scheduler	Scheduler>stop>task#20 Total Processing Time: 0.01 seconds.
2020-02-14T13:50:05+00:00	INFO 127.0.0.1	scheduler	Scheduler>start
2020-02-14T13:50:05+00:00	INFO 127.0.0.1	scheduler	Scheduler>stop>task#21 Total Processing Time: 0.01 seconds.
2020-02-14T13:50:06+00:00	INFO 127.0.0.1	scheduler	Scheduler>start
2020-02-14T13:50:06+00:00	INFO 127.0.0.1	scheduler	Scheduler>stop>task#22 Total Processing Time: 0.01 seconds.
2020-02-14T13:50:06+00:00	INFO 127.0.0.1	scheduler	Scheduler>start
2020-02-14T13:50:06+00:00	INFO 127.0.0.1	scheduler	Scheduler>stop>task#23 Total Processing Time: 0.01 seconds.
2020-02-14T13:50:06+00:00	INFO 127.0.0.1	scheduler	Scheduler>start
2020-02-14T13:50:06+00:00	INFO 127.0.0.1	scheduler	Scheduler>stop>task#24 Total Processing Time: 0.01 seconds.
2020-02-14T13:50:06+00:00	INFO 127.0.0.1	scheduler	Scheduler>start
2020-02-14T13:50:06+00:00	INFO 127.0.0.1	scheduler	Scheduler>stop>task#25 Total Processing Time: 0.01 seconds.
2020-02-14T13:50:06+00:00	INFO 127.0.0.1	scheduler	Scheduler>start
2020-02-14T13:50:06+00:00	INFO 127.0.0.1	scheduler	Scheduler>stop>task#26 Total Processing Time: 0.01 seconds.
2020-02-14T13:50:06+00:00	INFO 127.0.0.1	scheduler	Scheduler>start
2020-02-14T13:50:06+00:00	INFO 127.0.0.1	scheduler	Scheduler>stop>task#27 Total Processing Time: 0.01 seconds.
2020-02-14T13:50:08+00:00	INFO 127.0.0.1	scheduler	Scheduler>start
2020-02-14T13:50:08+00:00	INFO 127.0.0.1	scheduler	Scheduler>stop>task#28 Total Processing Time: 0.01 seconds.
2020-02-14T13:50:09+00:00	INFO 127.0.0.1	scheduler	Scheduler>start
2020-02-14T13:50:09+00:00	INFO 127.0.0.1	scheduler	Scheduler>stop>task#29 Total Processing Time: 0.01 seconds.
2020-02-14T13:50:22+00:00	INFO 127.0.0.1	scheduler	Scheduler>start
2020-02-14T13:50:22+00:00	INFO 127.0.0.1	scheduler	Scheduler>stop>task#30 Total Processing Time: 0.01 seconds.
2020-02-14T13:50:27+00:00	INFO 127.0.0.1	scheduler	Scheduler>start
2020-02-14T13:50:27+00:00	INFO 127.0.0.1	scheduler	Scheduler>stop>task#31 Total Processing Time: 0.01 seconds.
2020-02-14T13:50:38+00:00	INFO 127.0.0.1	scheduler	Scheduler>start
2020-02-14T13:50:39+00:00	INFO 127.0.0.1	scheduler	Job>jobone Task#1 Processing Time: 1.11 seconds.
2020-02-14T13:50:42+00:00	INFO 127.0.0.1	scheduler	Job>jobtwo Task#1 Processing Time: 3.01 seconds.
2020-02-14T13:50:42+00:00	INFO 127.0.0.1	scheduler	Scheduler>stop>task#32 Total Processing Time: 4.14 seconds.
2020-02-14T13:50:45+00:00	INFO 127.0.0.1	scheduler	Scheduler>start
2020-02-14T13:50:45+00:00	INFO 127.0.0.1	scheduler	Scheduler>stop>task#33 Total Processing Time: 0.03 seconds.
2020-02-14T13:50:50+00:00	INFO 127.0.0.1	scheduler	Scheduler>start
2020-02-14T13:50:51+00:00	INFO 127.0.0.1	scheduler	Scheduler>stop>task#34 Total Processing Time: 0.03 seconds.
2020-02-14T13:50:53+00:00	INFO 127.0.0.1	scheduler	Scheduler>start
2020-02-14T13:50:53+00:00	INFO 127.0.0.1	scheduler	Scheduler>stop>task#35 Total Processing Time: 0.02 seconds.
2020-02-14T13:51:36+00:00	INFO 127.0.0.1	scheduler	Scheduler>start
2020-02-14T13:51:36+00:00	INFO 127.0.0.1	scheduler	Scheduler>stop>task#36 Total Processing Time: 0.02 seconds.
2020-02-14T13:51:44+00:00	INFO 127.0.0.1	scheduler	Scheduler>start
2020-02-14T13:51:45+00:00	INFO 127.0.0.1	scheduler	Job>jobone Task#2 Processing Time: 1.01 seconds.
2020-02-14T13:51:45+00:00	INFO 127.0.0.1	scheduler	Scheduler>stop>task#37 Total Processing Time: 1.04 seconds.
2020-02-14T13:51:57+00:00	INFO 127.0.0.1	scheduler	Scheduler>start
2020-02-14T13:51:57+00:00	INFO 127.0.0.1	scheduler	Scheduler>stop>task#38 Total Processing Time: 0.02 seconds.
2020-02-14T13:52:19+00:00	INFO 127.0.0.1	scheduler	Scheduler>start
2020-02-14T13:52:19+00:00	INFO 127.0.0.1	scheduler	Scheduler>stop>task#39 Total Processing Time: 0.03 seconds.
2020-02-14T13:53:02+00:00	INFO 127.0.0.1	scheduler	Scheduler>start
2020-02-14T13:53:03+00:00	INFO 127.0.0.1	scheduler	Job>jobone Task#3 Processing Time: 1.02 seconds.
2020-02-14T13:53:06+00:00	INFO 127.0.0.1	scheduler	Job>jobtwo Task#2 Processing Time: 3.02 seconds.
2020-02-14T13:53:06+00:00	INFO 127.0.0.1	scheduler	Scheduler>stop>task#40 Total Processing Time: 4.05 seconds.

Testing webcron

  1. I deledted all log files

  2. on scheduler system plugin I set Webcron to yes/enable and set Key to mywebcronactivationkey

  3. In my browser i wrote the address: http://localhost/joomla-cms4/index.php?webcronkey=webcronactivationkey
    and I opened it twice.

  4. Log file output:

#
#<?php die('Forbidden.'); ?>
#Date: 2020-02-14 14:20:43 UTC
#Software: Joomla! 4.0.0-beta1-dev Development [ Mañana ] 17-October-2019 20:21 GMT

#Fields: datetime	priority clientip	category	message
2020-02-14T14:20:43+00:00	INFO 127.0.0.1	scheduler	Scheduler>start
2020-02-14T14:20:44+00:00	INFO 127.0.0.1	scheduler	Job>jobone Task#9 Processing Time: 1.16 seconds.
2020-02-14T14:20:47+00:00	INFO 127.0.0.1	scheduler	Job>jobtwo Task#7 Processing Time: 3.01 seconds.
2020-02-14T14:20:47+00:00	INFO 127.0.0.1	scheduler	Scheduler>stop>task#47 Total Processing Time: 4.46 seconds.
2020-02-14T14:32:28+00:00	INFO 127.0.0.1	scheduler	Scheduler>start
2020-02-14T14:32:29+00:00	INFO 127.0.0.1	scheduler	Job>jobone Task#10 Processing Time: 1.02 seconds.
2020-02-14T14:32:32+00:00	INFO 127.0.0.1	scheduler	Job>jobtwo Task#8 Processing Time: 3.20 seconds.
2020-02-14T14:32:32+00:00	INFO 127.0.0.1	scheduler	Scheduler>stop>task#48 Total Processing Time: 4.23 seconds.


Testing cli/cron

  1. I went to the cli folder of my website and run
    php joomla.php job:run
  2. I saw a notice, but the jobs are run.
    Screenshot from 2020-02-14 14-59-03

The output of the log file:

#
#<?php die('Forbidden.'); ?>
#Date: 2020-02-14 13:58:05 UTC
#Software: Joomla! 4.0.0-beta1-dev Development [ Mañana ] 17-October-2019 20:21 GMT

#Fields: datetime	priority clientip	category	message
2020-02-14T13:58:05+00:00	INFO -	scheduler	Starting Scheduler
2020-02-14T13:58:06+00:00	INFO -	scheduler	Job>jobone Task#4 Processing Time: 1.20 seconds.
2020-02-14T13:58:09+00:00	INFO -	scheduler	Job>jobtwo Task#3 Processing Time: 3.01 seconds.
2020-02-14T13:58:09+00:00	INFO -	scheduler	Scheduler tooks:4.218
avatar astridx astridx - test_item - 14 Feb 2020 - Tested successfully
avatar astridx
astridx - comment - 14 Feb 2020

I have tested this item successfully on 4d0589f


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25022.

avatar astridx astridx - test_item - 14 Feb 2020 - Tested successfully
avatar alikon
alikon - comment - 14 Feb 2020

thanks for testing
the PHP notice about the REMOTE_ADDR it has been already solved here :
joomla-framework/utilities#23
but that framework version of the utilities package it is still not in J4

avatar richard67
richard67 - comment - 14 Feb 2020

@alikon Meanwhile joomla-framework/utilities#23 is available in the 2.0-dev branch of the framework package, too, so yes, the package can be fetched to J4. 2 weeks ago that wasn't the case yet, there it was only in the master branch there.

avatar wilsonge
wilsonge - comment - 16 Feb 2020

Merged in the utilities update to 4.0-dev. I haven't taken any time to look through this yet - to be honest there's nothing in here b/c breaking so I'm not going to prioritise this either over the other beta blocking issues - if it has to go to 4.1 - it is what it is. But I will try and do an initial review as well over the next few days and give some opinions.

avatar twister65
twister65 - comment - 22 Feb 2020

Export database job plugin:
plg_job_exportdb.zip

This job plugin aims to export the entire database (zip archive) to the defined joomla tmp directory / sub-directory at a defined frequency.

JobExportDb

avatar twister65
twister65 - comment - 22 Feb 2020

I have tested this item successfully on 4d0589f

with the export database job plugin.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25022.

avatar twister65 twister65 - test_item - 22 Feb 2020 - Tested successfully
avatar alikon
alikon - comment - 13 Jun 2020

redone in #29592

avatar alikon alikon - close - 13 Jun 2020
avatar alikon alikon - change - 13 Jun 2020
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2020-06-13 08:31:32
Closed_By alikon
Labels Added: Conflicting Files
Removed: ?

Add a Comment

Login with GitHub to post a comment