2024.1 Server Configuration

2024.1 Server Configuration

The NetSuite Connector works by utilizing queues. Queues are pulled and managed from the CLI. Therefore, for the Connector to function properly, it is required to have the crond service installed and set up at the server (https://man7.org/linux/man-pages/man8/crond.8.html).

The main NetSuite processing CLI command to pull and to process Queues is a bin/magento netsuite:cron command. The elementary cron entry to make the NSC Queue work is explained below:

*/2 * * * * php __ROOT_PATH__/bin/magento netsuite:cron --mode all > /dev/null 2>&1

The command can be explained as follows:

  1. */2 * * * * - standard crond time expression. For possible options see https://crontab.guru/
  2. php __ROO_PATH__/bin/magento netsuite:cron --mode all - CLI command to be executed.
  3. > /dev/null 2>&1 - part of command that removes all output.

The command from the example above will take care of all NetSuite synchronization: It grabs product changes and stock levels, exports orders, imports invoices etc. Since this is single-threaded, it might be relatively slow.  However, the bin/magento  netsuite:cron command has other modes to operate. These modes are:

And B2B specific modes:

The modes can be combined with a comma. Here is an example that runs different processes in parallel:

*/5 * * * * php /home/dev/public_html/oDaBS2962/bin/magento netsuite:cron --mode importToQueue > /dev/null 2>&1
*/2 * * * * php /home/dev/public_html/oDaBS2962/bin/magento netsuite:cron --mode processQueue > /dev/null 2>&1
*/5 * * * * php /home/dev/public_html/oDaBS2962/bin/magento netsuite:cron --mode export > /dev/null 2>&1
*/30 * * * * php /home/dev/public_html/oDaBS2962/bin/magento netsuite:cron --mode stock > /dev/null 2>&1

Important Note

You can try to play with different cron command settings in the range of your project requirements. That said, typically, separating all processes is a much more efficient way to NSC operating. Also, splitting the import into 2 steps (importToQueue and process Queue) is useful in case of a huge amount of NetSuite changes for importing entities. For small projects and Dev/Staging environments, it is not required to do such splitting.

Note that NetSuite can use up to 4 simultaneous connections with one token. If your organization plans to use more than four at the same time, your company might need to consider separate connections for different process setups (see Separate Connection Configuration for Export, Import, and Stock: 2024.1 General settings).