This is a short guide on how to run grunt as a Scheduled Task on a Windows server. (This assumes that you have already added a "watch" task on your grunt production task.)
- Create a .bat file in the root website directory, with the only content being "grunt" or whichever grunt task you want to run.
- In Windows Server Manager, click on Configuration > Task Scheduler > Task Scheduler Library > Microsoft > Windows
- Click Create Basic Task
- Enter the name and description, click Next
- Select "When the computer stats" for when the task should start and click Next
- Under What action do you want the task to perform, select "Start a program" and click Next
- Under Action > Program/script type in the name of the .bat file (don't use Browse), and under Start in type in the full path to the website directory (if you don't do this and use Browse to path to the file it won't run). Click Next and Finish to finish creating have it auto open the properties.
- In the Properties pop-up dialog, under Security options, select "Run whether user is logged on or not" and "run with highest privileges"
No comments:
Post a Comment