Most of my scripts run one time per day, and those are fine. But I have others that must run every 30 minutes — between 8:00 AM and 7:00 PM, Monday to Friday. How do I get my scripts to work like that in AlwaysUp?
There are a couple of steps you should take run your scripts exactly when you want to.
1. Configure AlwaysUp to run your script every 30 minutes
By default, AlwaysUp runs your script 24/7, launching it at boot and quickly restarting it whenever it stops. But that’s clearly not what you want.
To run your script every 30 minutes, on the hour and half-hour:
Edit your script in AlwaysUp
Switch to the Restart tab. These settings determine what AlwaysUp does after your script exits.
Since you don’t want to restart your script immediately after it completes, select the Not immediately option.
Choose On the next hour and half-hour.
Check Minimize event logging as the application stops & restarts. That option tells AlwaysUp that frequent stops and starts are normal and shouldn’t cause panic. 🙂
Save your changes.
At this point, you should test your AlwaysUp entry and confirm that it behaves correctly. Once started, the script should run at the top and the bottom of the hour.
For example, we set up a batch file service as above. After an initial run, the state switched to “Waiting”. And clicking the clock icon showed AlwaysUp holding off until 3:30 for the next run (as expected):
2. Use Service Scheduler to control when your AlwaysUp service runs
So your script is now set to run every half-hour. Great! However, AlwaysUp will run it all day, every day — weekends included.
To make sure that your script runs only Monday through Friday between 8 AM and 7 PM:
Download our free Service Scheduler utility. (You can setup the Windows Task Scheduler instead, but Service Scheduler is much easier to use.)
Start Service Scheduler.
Select Service Task > New from the menu.
Configure the Add Service Task window to start your AlwaysUp-created service every weekday at 8 AM. The window should look like this:
Note that the name of the service will be whatever you called your script in AlwaysUp, plus the “(managed by AlwaysUpService)” suffix. For example, our AlwaysUp entry is named “Process Folder Script” so the corresponding service is called “Process Folder Script (managed by AlwaysUpService)”. And that’s what we selected in the screenshot above.
Click Save to create the new service task.
Finally, create another service task that stops the same service every weekday at 7 PM:
You should end up with a couple of tasks in Service Scheduler:
And that’s it. Going forward, AlwaysUp will run your script every 30 minutes, but only on weekdays between 8 AM and 7 PM.