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:
And the processing batch file will be very similar (notice the small variation in the URL parameter):
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:
Select Application > Add to open the Add Application window
In the Application field, enter the full path to the trigger batch file
In the Name field, enter a suitable name (we called ours “Trigger Import”)
Switch to the Logon tab. Check the box at the top and enter your Windows username and password:
Switch to the Restart tab. Here’s where you will set the batch file to run nightly.
Specify the time to run, ensure that the first run happens at the set time and minimize logging, as pictured:
Click the Save button to record your new task.
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:
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!