Bitrix Site Manager

Export explained

Exporting data from a catalog allows to set up the information interchange between your site and other sites or applications (for example, Microsoft Excel). The Export setup form helps you export the catalog information using both predefined and custom export templates. What is more, this form allows you to create export templates, place links to frequently used export templates and profiles to the menu, arrange for automated export execution through the use of agents or cron.

Developers will find the examples of templates in the Templates chapter.

There are two Export templates types: equipped with extra export settings (including step-by-step wizards), and without settings.

Parameterized templates

At startup time, the template first calls the appropriate export set-up script (export wizard) in which a user has to provide parameters required by the export template.

You can create a set of parameters and save it as an export template by using the command Add profile. When executing an export profile other than the default one, the export wizard is not launched; the export is performed on the basis of parameters previously saved in the profile.

You can have any export template set for the automated execution through the use of agents or cron (UNIX only), except the default template. This is because the default template assumes processing user input which cannot be accomplished in the automatic mode; all the required parameters must be stored in the profile beforehand.

Non-parameterized templates

Such templates are executed (that is, perform data export) right upon execution. No export profiles are created. A non-parameterized template does not assume extra parameters to be passed in and can be set up for automated execution via agents or cron.

The command Add to menu adds an appropriate item to the left menu of the administration section. The new menu item functions in the same way as the corresponding command Export of the form Export setup.

Agents

Agents are PHP functions which are run periodically at a given interval. Every time a page is requested, the system automatically checks for agents wanting execution and runs them if needed. It is not recommended to assign lengthy or large export jobs to agents. You should use the cron daemon for this purpose.

When you are setting an agent-aided export job, the system asks to provide the interval of execution. This is the period of time, in hours, at which the agent will run repeatedly starting from the current moment.

The cron daemon

The cron daemon works in the background and runs the assigned tasks at the specified time. Visitor traffic does not affect the task execution. The cron daemon allows running tasks both periodically and at the required time. The cron daemon is only available on UNIX-based servers.

When binding export jobs to cron, the system displays a request for both the period and time of execution, and the path to the PHP interpreter. If you provide the period of execution (in hours) , the export will execute automatically starting from the current moment. If you specify the exact time, the export will be performed every day at the time specified.

You can consult your hosting service provider for the path to the PHP interpreter.

The Bind to cron command adds a record to the configuration file (/bitrix/crontab/crontab.cfg) containing a list of current cron tasks. After you have changed the cron task list, you have to install the configuration file again. If the option Install automatically is enabled, the system will attempt to install it without your assistance. If you do not have enough permissions, such attempt may possibly fail. In this case, you have to connect to your site via the SSH or SSH2 or any other similar protocol supported by your provider for the shell remote operations and install the configuration file manually by typing the command:

crontab <full_path_to_crontab.cfg>

To view the list of currently installed tasks, run the command

crontab -l

List of currently installed tasks is also displayed at the bottom of the Export setup form (if you have enough permissions for the task list retrieval).

To remove all tasks assigned to cron, run the command

crontab -r

This will also remove any tasks which are not in the configuration file.

The cron job environment is the file: /bitrix/php_interface/include/catalog_export/cron_frame.php. Please ensure this file contains correct paths to PHP and site root.