How to Create a Scheduled Publish

 This article is suitable for an IT Adminstrator
Ref: 20090423
Last edited September 29th, 2011

Introduction

Quite often, when a Publication Server is set up, there is a scheduled publish set up to publish the Prelive and Sandpit sites.  Sometimes, however, it may be chosen to not have scheduled publications originally, but then you may want to set one up later. This article will go through the steps required to move through this process.
 

Create the scheduled task

Procedure in Windows Server 2003

  1. Log on to the Publication Server as the publication user (i.e. the user that runs the Triaster services, such as 'PN Publication Wrapper').
     
  2. Start > Control Panel.
     
  3. Open 'Scheduled Tasks'.
  4.  
  5. Double-click 'Add Scheduled Task'.
     
  6. On the first page of the 'Scheduled Task Wizard', click 'Next >'.
     
  7. On the next page, click 'Browse...', and select the appropriate scheduling CMD file, typically found in:
    "C:\Program Files\Triaster\PublicationServer\PublicationWrapper".
     
    Select 'schedule live.cmd', 'schedule prelive.cmd', or 'schedule sandpit.cmd'.
     
  8. When prompted, name the task, choose the appropriate schedule, typically 'Daily', and click 'Next >'.
     
  9. Set the 'Start time', amend the schedule, if necessary, and set the 'Start date'. Click 'Next >'.
     
  10. Enter the credentials of the publication user, and click 'Next >'.
  11. Tick 'Open advanced properties...', and click 'Finish'.
     
  12. Ensure 'Run only if logged on' is not ticked.
     
  13. Click the 'Schedule' tab, and check the settings.
     
  14. Click the 'Settings' tab, and set 'Stop the task if it runs for' to 1 hour.
     
    The task should take considerably less than this, as it's only writing a trigger file to a folder.
     
  15. Click OK to close the dialog.
     

Procedure in Windows Server 2008

  1. Log on to the server as the publication user (i.e. the user that runs the Triaster services, such as 'PN Publication Wrapper').
     
  2. Start > Administrative Tools > Task Scheduler.
     
  3. On the right-hand side of the window, in the Actions pane, click 'Create Task...'.
     
  4. In the 'Create Task' dialog, on the 'General' tab, enter an appropriate name for the task.
     
  5. Select the 'Run whether user is logged in or not' radio button.
     
  6. Tick 'Run with highest privileges'.
     
  7. Click the 'Triggers' tab.
     
  8. Click 'New...'.
     
  9. Set the appropriate schedule.
     
    Typically, Prelive and Sandpit publications are scheduled to run daily, at or shortly after midnight. Live publications aren't usually scheduled, but can be if required.
     
  10. Ensure 'Enabled' is ticked.
     
  11. Click OK to close the 'New Trigger' dialog.
     
  12. Click the 'Actions' tab.
     
  13. Click 'New...'.
     
  14. Ensure 'Action' is set to 'Start a program', click 'Browse...', and select the appropriate scheduling CMD file, typically found in:
    "C:\Program Files\Triaster\PublicationServer\PublicationWrapper".
     
    e.g. select 'schedule live.cmd', 'schedule prelive.cmd', or 'schedule sandpit.cmd'.
     
  15. Click OK to close the 'New Action' dialog.
     
  16. Click OK.
     
  17. Enter the publication user account user name and password, and click OK.
     

Check the schedule CMD files

The schedule CMD files are typically found in the PublicationWrapper folder, which is commonly in "C:\Program Files\Triaster\PublicationServer\PublicationWrapper".
schedule.cmd
schedule live.cmd
schedule prelive.cmd
schedule sandpit.cmd
 
Note: those distributed with Triaster Suite 10.1 need to be amended, as described below.
 

Schedule.cmd

Open schedule.cmd in Notepad.
 
Note: If running Windows that has User Account Control, e.g. Windows Server 2008, then Notepad needs to run 'as administrator' so that files within 'Program Files', a restricted location, can be edited.
 
It should look like this:
set PublicationQueueFolder=C:\Program Files\Triaster\PublicationServer\PublicationWrapper\Queue
set TaskName=%1
set TaskName=%TaskName:"=%
set FullTaskName=%PublicationQueueFolder%\%TaskName%.pntask
echo. > "%FullTaskName%"
 
  • Make sure that the path highlighted is pointing to the publication Queue directory, which will always be a sub-directory of the PublicationWrapper directory.
     
  • Double-quotes should only enclose the path represented by %FullTaskName%.
     
  • If the argument passed to this CMD file was enclosed within double-quotes (necessary, if the argument contains a space), those double-quotes are removed automatically so that a valid path is constructed.
     

Schedule <site name>.cmd

Open 'schedule <site name>.cmd' in Notepad.
 
Note: If running Windows that has User Account Control, e.g. Windows Server 2008, then Notepad needs to run 'as administrator' so that files within 'Program Files', a restricted location, can be edited.
 
It should contain a single command, like this:
"c:\program files\triaster\publicationserver\PublicationWrapper\schedule.cmd" PROCESSLIBRARY_LIVE >"c:\program files\triaster\publicationserver\PublicationWrapper\logs\Schedule live.log"
 
  • Ensure the paths specified are valid.
     
  • Ensure paths with spaces are enclosed within double-quotes.
     
  • Ensure the site name argument is enclosed within double-quotes if it contains a space.
     
 

Validation

To test a scheduled task:
  1. Stop the 'PN Publication Wrapper' service.
      
    This will prevent a publication from running, when we only want to check the initiation mechanism.
      
    1. Start > Administrative Tools > Services.
        
    2. Right-click 'PN Publication Wrapper' > Stop.
        
  2. Run the task.
     
    1. Open the Task Scheduler.
        
      Start > Administrative Tools > Task Scheduler.
        
    2. In the left-hand pane, click 'Task Scheduler Library'.
        
    3. In the middle-pane, right-click the task > Run.
       
  3. Check that the appropriate PNTASK file has been created in the Queue.
     
    1. In Windows Explorer, navigate to the Queue folder, typically:
      "C:\Program Files\Triaster\PublicationServer\PublicationWrapper\Queue"
       
    2. Check that the appropriate PNTASK file is there, e.g PROCESSLIBRARY_LIVE.pntask, PROCESSLIBRARY_PRELIVE.pntask.
       
  4. Delete all files from the Queue folder.
     
  5. Restart the 'PN Publication Wrapper' service.

 


Need further help? Contact the Triaster Support team by e-mailing support@triaster.co.uk or by calling us on 0870 402 1234.

                    Do you have any feedback or suggestions that you would like to share with Triaster? We would love to hear from you! Please e-mail feedback@triaster.co.uk 
Comments