Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

CRON Job Configuration in CS-Cart? - cPanel Configuration? Rate Topic   * * * * * 1 votes

Poll: DO YOU USE CRON JOBS WITH CS-CART? (9 member(s) have cast votes)

Have you successfully configured and run CS-Cart's CRON Jobs before?

  1. Yes - Store is fully automated. (2 votes [22.22%])

    Percentage of vote: 22.22%

  2. No - I do everything manually. (7 votes [77.78%])

    Percentage of vote: 77.78%

  3. Neither! I use third party scripts to do this for me. (0 votes [0.00%])

    Percentage of vote: 0.00%

Vote Guests cannot vote
 

Posted 14 March 2012 - 03:11 PM #1

Hello,

One thing I've never found well documented, well not that but more "not obvious", with CS-Cart was the set-up and configuration of CRON jobs. For example - What would be automated within CS-Cart and at what schedule.

Some years ago, being rather naive, we assumed many of the features below would be included in CS-Cart or the near future (v1.xx lol!), based on our experience with other eCommerce products. Having had clients provide us with feedback while others identifying a specific need, we assumed many of their requests and features would be implemented in due course (as were often available in other products, or custom modifications were required).


WISH LIST
Has anyone had experience and success with automation with any of these (general) 'CRON'-based functions?

CRON Jobs run every x hour(s) to perform and trigger:
  • Send emails regarding incomplete carts and their contents.
  • Send bulk emails to a group of customers (perhaps staggered - xxx per hour) - the 'Newsletter' feature in CS-Cart,
  • Syncronise and update exchange rates of configured currencies,
  • Creation, collation and compilation of various reports (built in or custom scope),
  • Export / create lists - such as Price Lists divided into various user group discounts,
  • Get latest transactions from Paypal (and other payment gateways) and display in Admin Area (like an admin home page widget),
  • Send stock requisitions to suppliers (for stock under x, and approved to be included in auto requests sent to configured suppliers, and perhaps cheapest price [highest priority] supplier if more than one),
  • Archiving system logs,
  • Backup of database,
  • Optimisation of database,
  • Additional backup of database,
  • Emailing / FTP transfer of backup,
  • Backup of /Images/,
  • Backup of /Skins/,
  • Backup of /Addons/
  • Even automatic restore of folders / database at set interval (perhaps for demonstrative or other reasons),
The possibilities are endless (should some of these features be coded or modified).

Having a page to configure these schedules, e.g. for backups to be done every 12 hours, and something else every hour, when the CRON job runs, then obviously not eveything is triggered, only when x number of times between last run and next run are greater than current time (something like that)... This would mean a 30 Minute cron, would still only send 1 backup ever 12 hours (as example above).

Fingers are crossed!


MY QUESTION
So what is the point of the "example" CRON job in the admin area for? It seems fairly vague and useless? Or perhaps it is capable of the points above! Who knows?!

Admin Settings - CRON Example:
> http:\\www.company.com/admin.php?dispatch=profiles.password_reminder&cron_password=xyz

Okay, so this means trigger password reminders, but.... shouldn't they be sent out "instantly" upon password reminder / reset request? (rather than waiting for 3 hourly CRON or even 30 minute CRON?). (note: slashes reversed to stop forum created link in URL above)


SYNTAX
What options are available to be exchanged with "profiles.password_reminder" to support other functions?
> http:\\www.company.com/admin.php?dispatch=________________&cron_password=key_value


Thanks for your help, I'm willing to donate to anyone for their time should they have anything documented or even ''developed'' that can make the process easier! :)

Cheers!

Thank you!


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 12028 posts

Posted 16 March 2012 - 01:40 AM #2

Are you requesting a general cron-activity addon that woud perform these functions? There would have to be a lot of interest in order for someone to devote the effort into doing this. However, you'd still need cron entries for each time period you want these activities to run it and most are better run outside the cart.

Most of your requests can be done better and more easily in cron, idependent of cs-cart (like all the various backups).
The email stuff is better handled by a 3rd party email processor such as mailchimp.
I wouldn't bother with doing anything with their reports - most are pretty useless for any practical use.
No idea about what you mean by "system logs". A log of cs-cart events is already in place.
Generally, html type parameters (those prefixed with '?' or '&' are not handled by cron correctly. Hence the use of syntax such as --password=foo which the command line php interperter will translate into a GET request of password=foo

I've posted cron interfaces here in the past, you should be able to search for it by 'cron_iface' or maybe just 'cron'. See message #8 here: http://forum.cs-cart...eed-214-import/

A good host will backup your full cart and database weekly with daily incrementals. Hence much of what you want would be redundant.

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • mehargags
  • Newbie
  • Trial users
  • Join Date: 30-Mar 17
  • 1 posts

Posted 10 April 2017 - 10:37 AM #3

I'm a sysadmin and not a cs-cart developer but I've seen many such road-block problems  before.

People who want to fire URLs like this https://domain.com/a...sword=cronp4944 via CRON can use cURL instead. so you can setup your CRON job as

curl --insecure https://domain.com/adminxxx?dispatch=crons.order_report&cron_password=cronp4944


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 12028 posts

Posted 10 April 2017 - 09:31 PM #4

In general, cron jobs should not be going through the web server (I.e. no protocol) and should execute specific php files directly that provide for their own authentication.  Note to pass parameters via cron you should use --parameter_name=value.

 

Obviously if you have a reason to use a webserver for a cron job, then by all means use curl or wget.  For our addons that use cron, we suggest the following type of cron command:

cd public_html; php -q ./app/addons/addon_name/cron_iface.php --password=whatever

This assumes the cron job is setup to run as the cpanel account user so the current directory would be like /home/cpanel_user.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.