36 lines
1.2 KiB
Markdown
36 lines
1.2 KiB
Markdown
- Run cron
|
|
<!-- Run simple -->
|
|
<!-- Cron run import product -->
|
|
|
|
wp cron event run wpi_import_products_cron --allow-root <!-- Call by cron -->
|
|
wp eval "do_action('wpi_import_products_cron');" --allow-root <!-- Call by CLI -->
|
|
|
|
<!-- Cron sync categories -->
|
|
|
|
wp cron event run wpi_sync_categories_cron --allow-root <!-- Call by cron -->
|
|
wp eval "do_action('wpi_sync_categories_cron');" --allow-root <!-- Call by CLI -->
|
|
|
|
<!-- Cron triger auto sync -->
|
|
|
|
wp cron event run wpi_trigger_import_cron --allow-root <!-- Call by cron -->
|
|
wp eval "do_action('wpi_trigger_import_cron');" --allow-root <!-- Call by CLI -->
|
|
|
|
- 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 post delete \
|
|
$(wp post list --post_type=product --field=ID --allow-root) \
|
|
--force --allow-root
|
|
|
|
# Xoá toàn bộ product categories
|
|
|
|
wp term delete product_cat \
|
|
$(wp term list product_cat --field=term_id --allow-root) \
|
|
--allow-root
|