The Core Technologies Blog

Professional Software for Windows Services / 24×7 Operation


Q&A: Can AlwaysUp Trigger a Daily Import into my WooCommerce Site?

Can AlwaysUp Trigger a Daily Import into my WooCommerce Site?
  We’re using WP All Import to import a CSV file into a WooCommerce site.

Can I use AlwaysUp to set up a nightly task that triggers WP All Import to perform the import, as described in this article?

Our site is running on Linux but our VPS provider doesn’t allow us to add a “cron job” to the machine and I’m hoping that AlwaysUp can help. We already use it for a couple of older Windows programs.

— Patrick S.

Hi Patrick, thanks for reaching out. And thanks for being a customer!

Yes, AlwaysUp can help definitely run your nightly task.

Basically, you should create batch files that import the data and then instruct AlwaysUp to kick off the batch files at scheduled times.

Let’s go through the process, step by step.

1. Create the “trigger” and “processing” batch files

Follow the instructions in the article you sent to create a couple of batch files.

The first batch file imports the data. It will run nightly, at a time of your choosing. Let’s call it the “trigger batch file”.

The second ensures that all data previously imported is fully processed, so we call it the “processing batch file”. It will run every couple of minutes.

Both scripts work by calling a special URL on your WooCommerce site. We recommend using the free cURL command line utility to help with that.

For example, the trigger batch file should contain a single line:

C:\apps\curl\curl.exe http://YOUR-WEBSITE.com/wp-load.php?import_key=[YOUR_SECRET_KEY]&import_id=[YOUR_IMPORT_ID]&action=trigger

And the processing batch file will be very similar (notice the small variation in the URL parameter):

C:\apps\curl\curl.exe http://YOUR-WEBSITE.com/wp-load.php?import_key=[YOUR_SECRET_KEY]&import_id=[YOUR_IMPORT_ID]&action=processing

Note that the path to curl.exe will be different on your system. Be sure to specify the correct path in your files and save them to a well-known location.

Our next job is to plug those files into AlwaysUp. Let’s start with the trigger batch file.

2. Add the trigger batch file to AlwaysUp

To have AlwaysUp run the trigger batch file every night:

  1. Start AlwaysUp

  2. Select Application > Add to open the Add Application window

  3. In the Application field, enter the full path to the trigger batch file

  4. In the Name field, enter a suitable name (we called ours “Trigger Import”)

    Trigger Import: General tab
  5. Switch to the Logon tab. Check the box at the top and enter your Windows username and password:

    Trigger Import: Logon tab
  6. Switch to the Restart tab. Here’s where you will set the batch file to run nightly.

  7. Specify the time to run, ensure that the first run happens at the set time and minimize logging, as pictured:

    Trigger Import: Restart tab
  8. Click the Save button to record your new task.

  9. And finally, select Application > Start to launch the nightly process.

2. Add the processing batch file to AlwaysUp

To install the processing batch file, follow the same steps you took to setup the trigger batch file. Other than the obvious variations — such as the name and the path to the batch file — specify a two minute interval as pictured here:

Process Data: Restart tab

AlwaysUp will run both batch files on your WooCommerce site as specified

With your two periodic tasks installed and managed by AlwaysUp, WP All Import will download your CSV file and update, delete, and create posts on your site according to your settings — every night.

Best of luck with your WooCommerce site!

Posted in AlwaysUp | Tagged , , , | Leave a comment

Leave a Reply

Your email address will not be published. Required fields are marked *