Skip to content

Instantly share code, notes, and snippets.

@bgrgicak
Last active July 13, 2021 10:44
Show Gist options
  • Save bgrgicak/de6c675c832276ae852cb3330f448e62 to your computer and use it in GitHub Desktop.
Save bgrgicak/de6c675c832276ae852cb3330f448e62 to your computer and use it in GitHub Desktop.
Import WooCommerce Admin orders using the Action scheduler CLI
#!/bin/bash
cd /var/www/
wp action-scheduler run --batch-size=10 --hooks=wc-admin_queue_batches_orders,wc-admin_import_batch_orders 2>&1 | awk -v commandid=$1 '{ "date +%Y-%m-%d\\ %T.%3N" | getline timestamp; print timestamp, commandid, $0; fflush(); }' >> ~/cli.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment