To create a support ticket, start a search

Automating exports with a CRON task

mars_article_03.jpgCRON is a time-based job scheduler in Unix-like computer operating systems. Cron enables users to schedule jobs (commands or shell scripts) to run periodically at certain times or dates

It is indeed interesting to get the system to run recurent and repetitive tasks automatically instead of involving a manual intervention by the user.

Here is how you can make your life easier by automating your exports using a CRON task.

  1. Configure your CSV export once to check that it works when ran manually
  2. Download the attached file
  3. Unzip the file and rename it cron_export_YYY.php (choose an recognisable name)
  4. Edit the file to configure it

 

The first lines allow to modify the configuration:

// Export script name, all options must be set and tested in Store Commander. (case sensitive)
// Export scripts are stored in /modules/storecommander/XXXX/SC_TOOLS/cat_export/
$_GET['filename']='Amazon.script.xml';

// internal security key to use in CRON ( you should call /modules/storecommander/XXXX/SC/cron_export_YYY.php?key=4hfsz65j4e68h4reh )

$localkey='4hfsz65j4e68h4reh';

// the export result is sent to this email address
$emailaddress='info@yourwebsite.com';

// email title
$emailtitle='[CRON] Export SC';

// website url for the link inluded in the email.
$websiteURL='http://www.yourwebsite.com';

// You can force the language used to export names and descriptions: ISO 2 characters
$forceLangIso = 'fr';

** Do not modify the following lines **


IMPORTANT Note : Do not use the security key above as it is used as an exemple for this article.

 

Then, add the file on your server in directory /modules/storecommander/XXX/SC/cron_export_YYY.php

You will then simply call this URL with the CRON task on your server:

/modules/storecommander/XXX/SC/cron_export_YYY.php?s_key=4hfsz65j4e68h4reh

 


 



Related articles