× English Section!

We will be more than happy to help you with problems related to our services and products. Please feel free to write it down as clear as possible

CSVI : Setting up a cron job in RO CSVI

Περισσότερα
3 Χρόνια 5 Μήνες πριν #113 από infogate
CSVI : Setting up a cron job in RO CSVI δημιουργήθηκε από infogate
Cron command requirements
The cron command is a combination of a few settings:

The PHP executable
The path to cron.php
The arguments
Let's take a closer look at these requirements.

PHP executable
The PHP executable is the program that processes the cron script. How the PHP executable is called completely depends on your host, check with them where your PHP executable resides. Some examples of the PHP executable are:

php
/usr/local/bin/php
Path to the cron.php file
The file that starts the import or export is called cron.php, this file can be called directly from the command line. The file is located in /administrator/components/com_csvi/helper/cron.php. It is important to know where the file is as you need to use the path to build the cron command. The full path needs to be the complete path to the cron.php file. The full path depends on your host, check with them what your path needs to be. Some examples of the full path are:

/home/domain/public_html/administrator/components/com_csvi/helper/cron.php
/www/administrator/components/com_csvi/helper/cron.php
Arguments for import and export
There are several arguments that need to be passed on to make the cron work. These arguments are:

The secret key as specified in the template

--key
The password belonging to the supplied username.

--template_name
--template_id
--template_alias
The name of the template that needs to be used. This must exactly match the name of the template in the template list. Instead of using the template name, the template alias or the template ID can also be used.

--file
The full path and name of the file to import. This is only used for imports. It is also possible to store the filename in the template by setting the source to load from server and specify the full path to the filename. Some examples of the full path and name are:
/home/domain/public_html/example.csv
/www/example.csv
Optional: the template option to override

--form.<fieldname>
Replace <fieldname> with the name of the field you want to override. To know the name of the fieldname, edit your template and click on the Cron button to show the field names.
CSVI cron help

Clicking on the Cron button will show the field names below the options in italic. Clicking the Cron button again, will hide the field names.

Arguments for maintenance
The maintenance task takes several arguments to run. These arguments are:

The task to execute, this is always maintenance

--task="maintenance"
The name of the extension to run the maintenance task for. This is always the internal name of the extension.

--addon
For example for VirtueMart the arguement addon will be --addon="virtuemart".

The name of the operation to run.

--operation
Maintenance operations supported by addons are listed below.

VirtueMart

--operation="sortcategories" (Sorting Categories)
--operation="removeemptycategories" (Removing empty categories)
--operation="removeproductprices" (Removing Product prices)
--operation="unpublishproductbycategory" (Unpublish products if the category it belong to is unpublished)
--operation="removeproductmedialink" (Remove link between Product and images)
--operation="backupvm" (Backup VirtueMart Database. Backup file will be saved at tmp/com_csvi)
--operation="emptydatabase" (Empty VirtueMart tables)
--operation="vmexchangerates" (Load exchange rates for VirtueMart)
--operation="ecbexchangerates" (Load European central bank exchange rates)
--operation="cleanmediafiles" (Clean media files for which images are missing)
--operation="checkduplicateskus" (Check if there are duplicate SKUs in VirtueMart tables)
--operation="refreshsefurls" (Refresh SEF URLs)
--operation="relatedproductsduplicates" (Check for Duplicate related products and categories)
HikaShop

--operation="removeproductprices" (Remove prices linked to products)
--operation="emptydatabase" (Empty HikaShop Tables)
--operation="refreshsefurls" (Refresh SEF URLs for product export)
K2

--operation="refreshsefurls" (Refresh SEF URLs for product export)
J2Store

--operation="removeproductprices" (Remove prices linked to products)
--operation="emptydatabase" (Empty J2Store Tables)
Joomla Content

--operation="refreshsefurls" (Refresh SEF URLs for export)
Build the cron command
With all the requirements in place we can build the cron command. The command is build up in this order:
PHP executable path to the cron.php arguments

Including the arguments the full command for an import can look like this:
Using template name in argument
/usr/local/bin/php /home/domain/public_html/administrator/components/com_csvi/helper/cron.php --key="mysecretword"
 --template_name="CSVI Product import" --file="/home/domain/public_html/example.csv"
Using template ID in argument
/usr/local/bin/php /home/domain/public_html/administrator/components/com_csvi/helper/cron.php --key="mysecretword"
 --template_id="123" --file="/home/domain/public_html/example.csv"
Including the arguments the full command for an export can look like this:

Using template name in argument
/usr/local/bin/php /home/domain/public_html/administrator/components/com_csvi/helper/cron.php --key="mysecretword" 
 --template_name="CSVI Product export"
Using template ID in argument
/usr/local/bin/php /home/domain/public_html/administrator/components/com_csvi/helper/cron.php --key="mysecretword"
 --template_id="124"
Using language name in argument
/usr/local/bin/php /home/domain/public_html/administrator/components/com_csvi/helper/cron.php --key="mysecretword"
 --template_id="124" --form.language="nl-NL"
Including the arguments the full command for a maintenance task can look like this:

Below command is an example for optiomizetables Maintenance task using CSVI cron
/usr/local/bin/php /home/domain/public_html/administrator/components/com_csvi/helper/cron.php --task="maintenance"
 --addon="csvi" --operation="optimizetables"
Make sure this command is all on one line. In a cronjob you cannot span a command across multiple lines.

Need help?
The cron command comes with a built-in help screen. You can get the help screen by issueing this command:
/usr/local/bin/php /home/domain/public_html/administrator/components/com_csvi/helper/cron.php --help
Setting up the cron command
How to setup the cron command depends on your host. Check with them how to set it up for your site. There are 2 control panel systems used often, these are cPanel and DirectAdmin, instructions for these follow here.

cPanel
Login to cPanel for your site
Click on Cron Jobs in the Advanced area.
cPanel advanced cron
Select the time you want the job to run in the Add New Cron Job
Fill in your cron command in the Command box
cPanel cron setting
Click on Add New Cron Job
The job is now scheduled
DirectAdmin
Login to DirectAdmin for your site
Click on Cronjobs in the Advanced Features area
directadmin advanced cron
Fill in the time you want the job to run in the Create a New Cron Job
Fill in your cron command in the Command box
directadmin cron setting
Click on Add
The job is now scheduled
The output
The output has been optimized for command line output, this means there is no HTML code. This can be forwarded (piped) to a file for later analyzes.


The best possible way to start your online marketing : fspirits.com/go/leadsleap-home
Explode Your Web Site Traffice: fspirits.com/go/sparktraffic
Start your affiliate journey here: fspirits.com/go/olsp-academy
Best Solution To Create Videos: fspirits.com/go/create-studio-pro
Best Solution To Create Graphics: fspirits.com/go/clickdesigns
Smart Chat Automation: fspirits.com/go/chatterpal
Multi-Purpose Video Maker: fspirits.com/go/avatar-builder
Multi-Purpose Video Creator: fspirits.com/go/video-creator
AI Human Spokesperson Videos: fspirits.com/go/humanpal

Παρακαλούμε Σύνδεση ή Δημιουργία λογαριασμού για να συμμετάσχετε στη συζήτηση.

Χρόνος δημιουργίας σελίδας: 0.080 δευτερόλεπτα
Powered by Kunena Φόρουμ