Jump to content

Prestashop cron jobs not working


abdukannur

Recommended Posts

Hi all, 

 

I have created a cron job at 'cron tasks manager' (v 1.4.0) for updating currency rates, but it doesn't execute.

I also installed module named 'crontab for prestashop' (v 2.0.1 by samdha), still it doesn't execute.

(screen shots of both modules attached)

 

Is there any other settings I have to change for the cron to work?

 

Prestashop version 1.6.1.5

post-1376908-0-90780000-1493877908_thumb.png

post-1376908-0-73137400-1493877916_thumb.png

Link to comment
Share on other sites

Hi, according to my experience the built in cron function is broke. It never worked for me either. The easiest way to get crons working is to setup a cron job in your hosting account or Server. This is the way i am doing it and it works perfect.

Link to comment
Share on other sites

Hi, according to my experience the built in cron function is broke. It never worked for me either. The easiest way to get crons working is to setup a cron job in your hosting account or Server. This is the way i am doing it and it works perfect.

 

@jetway

 

I have tried that too, but it is not working.

 

Is there any other settings to be enabled for that to work? I have enabled 'prestashop webservice' under advanced parameters>webservices.

Edited by abdukannur (see edit history)
Link to comment
Share on other sites

Every cron module will needs an external trigger - external webservice that visits the cron page/endpoint.

 

Cron Task Manager module has a nice feature - in basic mode it will automatically subscribe your site to prestashop cron webservice, so you don't need to worry about these.

 

Unfortunately this subscription mechanism is somewhat buggy. In order to make it work, you usually have to

 

1) switch to Advanced mode - save

2) switch to Basic mode - save

 

by switching mode the subscription will be renewed. It has worked for me.

 

It this doesn't work, you will need to switch to advanced mode and use your own cron webservice

Link to comment
Share on other sites

I have the same issue. 

 

Im using a multistore, but only default store gets updated.

 

I had this problem before with Presta 1.6 and the found an article on forge.prestashop. This one I cant find any more, but what it came down to is that something in a file had to be changed for all stores to update. 

 

I keep looking for this post, if I can find it Ill update you - Or is someone from the community knows what im talking about, please link

Link to comment
Share on other sites

  • 11 months later...

Here is the solution which worked for me on two different Prestashop 1.6 and 1.7 which is hosted on different servers but both are using cpanel.

Initially, It was not working for me too, but after doing some googling and trying some combination of setting, I came up with a working solution.

1. Go to module cronjobs in your shop back office.
2. select mode as Advanced 
3. Save it
4. Now add a new task by clicking plus sign under "CRON TASKS" tab
5. Provide the details: 
    5.1 Task Description: ANY Thing
    5.2 Target Link: URL which you want to be part of cron, but check this URL in a browser window whether it is working or not.
    5.3 Task Frequency: must do bellow setting (This setting is not going to work) but should be set as mention below.
            Every Hour
            Every day of the month 
            Every Month
            Every day of the week
    5.4 Save
Finally, It should look like 1.jpeg attached image.

Now there are two ways to proceed further either using Cpanel or SSH

By Cpanel
1. Open Cpanel 
2. Goto Advanced Tab
3. Click on the cron job
4. Enter your mail and update it
5. Then goto bellow section "Add New Cron Job."
6. Select the setting from the drop-down "Common Setting" this is the setting which will decide at what time script will execute, It will automatically fill bellow some fields 
7. But there is one filed is still empty Command, to fill filed do bellow steps 
    7.1 Go to the shop back office, Goto module cronjobs
    7.2 Under Advanced option you will see the command, something like this 
        0 * * * * curl -k "https://www.abc.com/backoffice/index.php?controller=AdminCronJobs&token=b7ad52c1870c1f7a758c281dd92b333c"
    7.3 From this command  copy from curl to last
    7.4 Past it here
8. Click on Add New Cron Job.
Done, Now you will now receive mail when cron job gets executed with the result

By SSH
1. Connect SSH
2. Type command "crontab -e"
3. It will open vim editor where you need to mention some code; You can find that code by below steps:
    3.1 Go to the shop back office, Goto module cronjobs
    3.2 Under Advanced option you will see the command, something like this 
        0 * * * * curl -k "https://www.abc.com/backoffice/index.php?controller=AdminCronJobs&token=b7ad52c1870c1f7a758c281dd92b333c"
    3.3 now in the command change this part "0 * * * *" as per your requirement, This is setting which will tell at what frequency you want to execute cron jobs
        You can calculate it also very quickly by this link https://crontab.[spam-filter]/
    3.4 Now your command may look like this 0 0 * * * curl -k "https://www.abc.com/backoffice/index.php?controller=AdminCronJobs&token=b7ad52c1870c1f7a758c281dd92b333c"
    3.5 Now final code
    
        MAILTO="[email protected]"
        0 0 * * * curl -k "https://www.abc.com/backoffice/index.php?controller=AdminCronJobs&token=b7ad52c1870c1f7a758c281dd92b333c"
    3.6 Past it here
    3.7 Save file and Exit
4. Done, Now you will receive mail when the job gets executed.

1.jpeg

  • Thanks 2
Link to comment
Share on other sites

  • 4 months later...
  • 1 month later...
  • 5 months later...
  • 9 months later...
On 4/12/2018 at 5:22 PM, shobhitverma said:

Here is the solution which worked for me on two different Prestashop 1.6 and 1.7 which is hosted on different servers but both are using cpanel.

Initially, It was not working for me too, but after doing some googling and trying some combination of setting, I came up with a working solution.

1. Go to module cronjobs in your shop back office.
2. select mode as Advanced 
3. Save it
4. Now add a new task by clicking plus sign under "CRON TASKS" tab
5. Provide the details: 
    5.1 Task Description: ANY Thing
    5.2 Target Link: URL which you want to be part of cron, but check this URL in a browser window whether it is working or not.
    5.3 Task Frequency: must do bellow setting (This setting is not going to work) but should be set as mention below.
            Every Hour
            Every day of the month 
            Every Month
            Every day of the week
    5.4 Save
Finally, It should look like 1.jpeg attached image.

Now there are two ways to proceed further either using Cpanel or SSH

By Cpanel
1. Open Cpanel 
2. Goto Advanced Tab
3. Click on the cron job
4. Enter your mail and update it
5. Then goto bellow section "Add New Cron Job."
6. Select the setting from the drop-down "Common Setting" this is the setting which will decide at what time script will execute, It will automatically fill bellow some fields 
7. But there is one filed is still empty Command, to fill filed do bellow steps 
    7.1 Go to the shop back office, Goto module cronjobs
    7.2 Under Advanced option you will see the command, something like this 
        0 * * * * curl -k "https://www.abc.com/backoffice/index.php?controller=AdminCronJobs&token=b7ad52c1870c1f7a758c281dd92b333c"
    7.3 From this command  copy from curl to last
    7.4 Past it here
8. Click on Add New Cron Job.
Done, Now you will now receive mail when cron job gets executed with the result

By SSH
1. Connect SSH
2. Type command "crontab -e"
3. It will open vim editor where you need to mention some code; You can find that code by below steps:
    3.1 Go to the shop back office, Goto module cronjobs
    3.2 Under Advanced option you will see the command, something like this 
        0 * * * * curl -k "https://www.abc.com/backoffice/index.php?controller=AdminCronJobs&token=b7ad52c1870c1f7a758c281dd92b333c"
    3.3 now in the command change this part "0 * * * *" as per your requirement, This is setting which will tell at what frequency you want to execute cron jobs
        You can calculate it also very quickly by this link https://crontab.[spam-filter]/
    3.4 Now your command may look like this 0 0 * * * curl -k "https://www.abc.com/backoffice/index.php?controller=AdminCronJobs&token=b7ad52c1870c1f7a758c281dd92b333c"
    3.5 Now final code
    
        MAILTO="[email protected]"
        0 0 * * * curl -k "https://www.abc.com/backoffice/index.php?controller=AdminCronJobs&token=b7ad52c1870c1f7a758c281dd92b333c"
    3.6 Past it here
    3.7 Save file and Exit
4. Done, Now you will receive mail when the job gets executed.

1.jpeg

Good afternoon! Did according to yours. The crown is never executed. In letters comes the answer: / bin / sh: 1: curl: not found
What could be wrong?

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
×
×
  • Create New...