cancel
Showing results for 
Search instead for 
Did you mean: 

What's wrong in my custom module? mg2

What's wrong in my custom module? mg2

I have a cronjob module, the module and cronjobs are executing ok. But on the wrong day of the week :

 

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">
<group id="snackbar">
<job name="SNACKBAR: website aan woo" instance="BasicICTsolutions\CronSnackbar\Cron\WebsiteAan" method="execute">
<schedule>1 1 * * 0,3-6</schedule>
</job>
<job name="SNACKBAR: website uit wo do" instance="BasicICTsolutions\CronSnackbar\Cron\WebsiteUit" method="execute">
<schedule>25 18 * * 3,4</schedule>
</job>
<job name="SNACKBAR: website uit vri zat" instance="BasicICTsolutions\CronSnackbar\Cron\WebsiteUit" method="execute">
<schedule>55 18 * * 5,6</schedule>
</job>
<job name="SNACKBAR: website uit zon" instance="BasicICTsolutions\CronSnackbar\Cron\WebsiteUit" method="execute">
<schedule>55 17 * * 0</schedule>
</job>
<job name="SNACKBAR: aanbieding aan ma" instance="BasicICTsolutions\CronSnackbar\Cron\AanbiedingAan" method="execute">
<schedule>15 3 * * 1</schedule>
</job>
<job name="SNACKBAR: aanbieding uit vr" instance="BasicICTsolutions\CronSnackbar\Cron\AanbiedingUit" method="execute">
<schedule>50 1 * * 3</schedule>
</job>
<job name="SNACKBAR: geopend geen bezorging sochtends" instance="BasicICTsolutions\CronSnackbar\Cron\GeopendAanBezorgenUit" method="execute">
<schedule>20 9 * * 3-6</schedule>
</job>
<job name="SNACKBAR: geopend geen bezorging zondag middag" instance="BasicICTsolutions\CronSnackbar\Cron\GeopendAanBezorgenUit" method="execute">
<schedule>55 12 * * 0</schedule>
</job>

<job name="SNACKBAR: geopend en bezorging smiddags" instance="BasicICTsolutions\CronSnackbar\Cron\BezorgenAan" method="execute">
<schedule>50 14 * * 0,3-6</schedule>
</job>
<job name="SNACKBAR: geopend en geen bezorging s avonds" instance="BasicICTsolutions\CronSnackbar\Cron\BezorgenUit" method="execute">
<schedule>50 17 * * 3-6</schedule>
</job>
</group>
</config>

 

They are executing evrey day of the week and not on the day i have planned.

 

Anyone have a clou to solved this?

4 REPLIES 4

Re: What's wrong in my custom module? mg2

Hi @reneeetje

 

Looks like cron timing are not properly set.

 

Below is the configuration and exact meaning of cron digit :

 

# Use the hash sign to prefix a comment
    # +---------------- minute (0 - 59)
    # |  +------------- hour (0 - 23)
    # |  |  +---------- day of month (1 - 31)
    # |  |  |  +------- month (1 - 12)
    # |  |  |  |  +---- day of week (0 - 7) (Sunday=0 or 7)
    # |  |  |  |  |
    # *  *  *  *  *  command to be executed
    #--------------------------------------------------------------------------

So you need to set your cron timings according to the above rules i have applied , like if you wanted to set cron for day of week then you need to set it by using above notes !

 

Also you can refer this link for the same - http://corntab.com/

 

Hope it helps !

if issue solved,Click Kudos & Accept as Solution

Re: What's wrong in my custom module? mg2

Changed setting but still not on the right day or time. :

 

<job name="SNACKBAR: website aan ma di do vrij" instance="BasicICTsolutions\CronSnackbar\Cron\WebsiteAan" method="execute">
<schedule>1 1 * * 5,6,0,1</schedule>
</job>

 

but day 5 = wed, day 6 = thu, 0= fri, 1= sat instead of 3,4,5,6 strange....., this also aplies to the other cronjobs. 

 

time = 3:00 am. but u think that is CEST/CET differnce.

 

The only way i can controle this is to use above settings. 

 

 

Re: What's wrong in my custom module? mg2

okay .

so using above settings your issue gets resolved ? or you still have issue on this ?
if issue solved,Click Kudos & Accept as Solution

Re: What's wrong in my custom module? mg2

Did not get this to work: i tested it with one cornjob :

<job name="SNACKBAR_aanbieding_aan" method="execute" instance="BasicICTsolutions\CronSnackbar\Cron\AanbiedingAan" >
<schedule>0 1 * * 3</schedule>
</job>

in cronjob manager, comes this :

3148883
SNACKBAR_aanbieding_aan
In afwachting
 
Jan 1, 2019 11:45:16 AM
Jan 7, 2019 2:00:00 AM

 

Date execution time is 7 januari but that is not a wednesday!

if i set scheduled ahead longer i get this :

executen date 7 / 18 / 24 

It looks dat day of the week is not working!