Running uRapidFlow profiles using cron job

urapidflow.php
<?php
 
ini_set('display_errors', 1);
error_reporting(E_ALL);
 
use Magento\Framework\ObjectManagerInterface;
 
try {
//    if you move this file, adjust bootstrap.php path
    require __DIR__ . '/app/bootstrap.php';
} catch (\Exception $e) {
    echo <<<HTML
{$e->getMessage()}
</div>
HTML;
    exit(1);
}
 
error_reporting((E_ALL | E_STRICT) ^ E_DEPRECATED);
ini_set('display_errors', 1);
 
$params = $_SERVER;
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'admin'; // change this to appropriate store if needed.
$params[\Magento\Store\Model\Store::CUSTOM_ENTRY_POINT_PARAM] = true;
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params); // bootstrap
 
/** @var \Magento\Framework\App\Http $app */
$app = $bootstrap->createApplication('Magento\Framework\App\Http');
 
// configure environment
$om = $bootstrap->getObjectManager();
$areaCode = 'adminhtml';
 
/** @var \Magento\Framework\App\State $state */
$state = $om->get('Magento\Framework\App\State');
$state->setAreaCode($areaCode);
 
/** @var \Magento\Framework\ObjectManager\ConfigLoaderInterface $configLoader */
$configLoader = $om->get('Magento\Framework\ObjectManager\ConfigLoaderInterface');
 
$omCfgLoaded = $configLoader->load($areaCode);
if ($configLoader instanceof \Magento\Framework\App\ObjectManager\ConfigLoader\Compiled) {
    $pfsDiVal = @$omCfgLoaded['arguments']['Magento\Catalog\Model\Indexer\Product\Flat\State'];
    if (is_array($pfsDiVal) && isset($pfsDiVal['isAvailable']) && is_array($pfsDiVal['isAvailable'])) {
        $pfsDiVal['isAvailable']['_v_'] = false;
    } elseif (!is_array($pfsDiVal)) {
        $pfsDiVal = @unserialize($pfsDiVal);
        if (!is_array($pfsDiVal)) {
            $pfsDiVal = [];
        }
        $pfsDiVal['isAvailable'] = false;
        $pfsDiVal = serialize($pfsDiVal);
    }
    $omCfgLoaded['arguments']['Magento\Catalog\Model\Indexer\Product\Flat\State'] = $pfsDiVal;
} else {
    $omCfgLoaded['Magento\Catalog\Model\Indexer\Product\Flat\State']['arguments']['isAvailable'] = false;
}
 
$om->configure($omCfgLoaded);
 
$rfHelper = $om->get('\Unirgy\RapidFlow\Helper\Data');
 
// run profile using name:
$rfHelper->get('\Unirgy\RapidFlow\Helper\Data')->run('Import Products');
 
// create a batch export:
$rfHelper->run("Export EAV");
$rfHelper->run("Export Categories");
$rfHelper->run("Export Products");
$rfHelper->run("Export Product Extra Data");
# daily import
0 1 * * * /usr/bin/php -f /magento/root/urapidflow.php
# OR
0 2 * * * /usr/bin/lynx -dump http://localhost/magento/urapidflow.php