Jump to content

WHMCS - 7.10.3 - Manuel Cron Problem


Recommended Posts

Hello everyone,

We are using WHMCS version 7.10.3.

Our PHP version is 7.3.29

We decided to exclude CurrencyUpdateExchangeRates and CurrencyUpdateProductPricing crons in automation settings. You can see in screenshot 1. 

Than, we added these two crons manually in our Plesk panel with following this documentation https://docs.whmcs.com/Crons

/opt/plesk/php/7.3/bin/php -q /var/www/vhosts/username/domain.com/crons/cron.php do --CurrencyUpdateExchangeRates

/opt/plesk/php/7.3/bin/php -q /var/www/vhosts/username/domain.com/crons/cron.php do --CurrencyUpdateProductPricing

We would like to run this crons different time than general crons. So when we run it, crons seems to be started but nothing happens.

We can see it startes in Activity Log. You can see in screenshot 2 .

If we go to manually  Setup -> Payments -> Currencies and click to  Update Exchange Rates or Update Product Prices buttons it works.

How can we fix that?

Thank you for the help.

whmcs-1.jpeg

whmcs-2.jpeg

Link to comment
Share on other sites

On 7/29/2021 at 12:45 PM, pRieStaKos said:

How did you excluded the specific tasks ? You used `skip --CurrencyUpdateExchangeRates`  on main cron.php and `do --CurrencyUpdateExchangeRates` on other with different time ?

Check this https://docs.whmcs.com/Cron_Job_Issues to see if any error come up with the cron job.

I think you misunderstood me. We enter Automation Settings in our WHMCS Panel.  As i mention in screenshot 1;
There is a setting called "Currency Auto Update Settings". We just unclicked Exchange Rates and Product Prices.

So WHMCS crons do every job except theese two. Then, in our Plesk panel, we added 2 crons as i mention above. There is no error as you can see in log screenshot. Cron returns succesfully but Exchange rates and Product prices are not updating.

We would like to do update Exchange Rates and Product Prices  by ourself with  --do.

 

Link to comment
Share on other sites

  • 2 weeks later...
On 8/1/2021 at 1:29 PM, pRieStaKos said:

That’s cause you have disabled the feature from Settings. 
 

- Try to enable it again,

- Go to cron.php and add ‘skip’ and on your other cron add ‘do’. 

I'm sorry to disturb you again, but i'm still unable to fix this issiue.
I enabled. Now, the currency rates are updated but product prices remain the same.

I couldn't understand when you say : " go to cron.php and add..."

We have just one cron, which is running every 5 minutes and just fetching a script (cron.php file)

Then, 2 additional  cron we added manually.

Here are the screenshots;

cron1.jpg

cron2.jpg

Link to comment
Share on other sites

You must “skip” the currency rate sync on the cron you set to run daily and “do” on the cron you set manually. With this you will have one cron for the automation settings and actions (without currency sync) and your cron job to sync the currency rate at the time you have set the cron job to run.

Example:

php -q /home/username/crons/cron.php skip —CurrencyUpdateExchangeRates

This should be the main WHMCS cron job. This will run everything except currency exchange rate sync.


php -q /home/username/crons/cron.php do —CurrencyUpdateExchangeRates

This should be you manually cron (set to run at the desired time). It will run only the currency exchange rate sync.

Repeat for any other Tasks, by adding the —taskname with space.

 

Edited by pRieStaKos
Link to comment
Share on other sites

30 minutes ago, pRieStaKos said:

You must “skip” the currency rate sync on the cron you set to run daily and “do” on the cron you set manually. With this you will have one cron for the automation settings and actions (without currency sync) and your cron job to sync the currency rate at the time you have set the cron job to run.

So, if i understand correctly ;

I should change main cron to Run a command  instead of Run a PHP script.

Like;

/opt/plesk/php/7.3/bin/php -q /path-to-folder/crons/cron.php skip --CurrencyUpdateExchangeRates --CurrencyUpdateProductPricing

This command should run every 5 minutes.

 

I will then add 2 more tasks to make it run whenever I want:

/opt/plesk/php/7.3/bin/php -q /path-to-folder/crons/cron.php do --CurrencyUpdateExchangeRates
/opt/plesk/php/7.3/bin/php -q /path-to-folder/crons/cron.php do --CurrencyUpdateProductPricing

 

Am i understand clearly? : )

 

EDIT: I saw your updated comment. We meant the same thing. I will test it as soon as possible.

 

 

Edited by Boran
Link to comment
Share on other sites

6 hours ago, pRieStaKos said:

On skip or do ? Check the related option on Setup > General Settings

On do, which is my extra cron.

But in the General Settings, boths are enabled( currenxy exchange, product price update)

But on the main cron i added skip for both. When i check the system, i can already see theese 2 crons not working on main cron as i  wanted.

php do CurrencyUpdateExchangeRates works .

php do CurrencyUpdateProductPricing not 😞

Link to comment
Share on other sites

  • 1 month later...
On 8/18/2021 at 2:58 PM, pRieStaKos said:

Thanks for the help.

I checked all. I think this is a BUG on this version.

Because, when i run with ssh command, it shows crons complated successfully. 

While CurrencyUpdateExchangeRates actually works, CurrencyUpdateProductPricing  isn't. 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated