1.5 KiB
-
Run cron
wp cron event run wpi_import_products_cron --allow-root wp eval "do_action('wpi_import_products_cron');" --allow-root wp eval "do_action('wpi_import_products_cron', ['worker' => 1]);" --allow-root
wp cron event run wpi_sync_categories_cron --allow-root wp eval "do_action('wpi_sync_categories_cron');" --allow-root
wp cron event run wpi_trigger_import_cron --allow-root wp eval "do_action('wpi_trigger_import_cron');" --allow-root
wp cron event run wpi_dispatch_import_workers --allow-root wp eval "do_action('wpi_dispatch_import_workers');" --allow-root
-
Run Cron tabs 0 2 * * * cd /var/www/html && wp cron event run wpi_trigger_import_cron --allow-root >> /var/log/wp-trigger-import.log 2>&1
-
-
-
-
- cd /var/www/html && wp cron event run wpi_import_products_cron --allow-root >> /var/log/wp-import-products.log 2>&1
-
-
-
-
-
CLI WP
Xoá toàn bộ products
wp --allow-root post delete $(wp --allow-root post list --post_type=product,product_variation --format=ids) --force
Cài WP CLI
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar php wp-cli.phar --info chmod +x wp-cli.phar mv wp-cli.phar /usr/local/bin/wp