Task Scheduler - Task is not repeating

0

0

I have a script that automatically fetches origin from github and pulls it. When I run it by clicking it, it works.

I made a task in Task Scheduler that would constantly run the script every one minute. When I press "run" from Task Scheduler, it works, but only once.

Here are the settings I put: Triggers: At Startup - After triggered, repeat every 00:01:00 indefinitely

Here is the XML of the task:

<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
  <RegistrationInfo>
    <Date>2020-02-03T18:25:16.5644864</Date>
    <Author></Author>
    <URI>\Pull from Github (YJJ City Site)</URI>
  </RegistrationInfo>
  <Triggers>
    <BootTrigger>
      <Repetition>
        <Interval>PT1M</Interval>
        <StopAtDurationEnd>false</StopAtDurationEnd>
      </Repetition>
      <Enabled>true</Enabled>
    </BootTrigger>
    <CalendarTrigger>
      <Repetition>
        <Interval>PT1M</Interval>
        <StopAtDurationEnd>false</StopAtDurationEnd>
      </Repetition>
      <StartBoundary>2020-02-03T08:00:00</StartBoundary>
      <Enabled>true</Enabled>
      <ScheduleByDay>
        <DaysInterval>1</DaysInterval>
      </ScheduleByDay>
    </CalendarTrigger>
  </Triggers>
  <Principals>
    <Principal id="Author">
      <LogonType>Password</LogonType>
      <RunLevel>HighestAvailable</RunLevel>
    </Principal>
  </Principals>
  <Settings>
    <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
    <DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries>
    <StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
    <AllowHardTerminate>true</AllowHardTerminate>
    <StartWhenAvailable>false</StartWhenAvailable>
    <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
    <IdleSettings>
      <StopOnIdleEnd>true</StopOnIdleEnd>
      <RestartOnIdle>false</RestartOnIdle>
    </IdleSettings>
    <AllowStartOnDemand>true</AllowStartOnDemand>
    <Enabled>true</Enabled>
    <Hidden>false</Hidden>
    <RunOnlyIfIdle>false</RunOnlyIfIdle>
    <WakeToRun>false</WakeToRun>
    <ExecutionTimeLimit>PT0S</ExecutionTimeLimit>
    <Priority>7</Priority>
  </Settings>
  <Actions Context="Author">
    <Exec>
      <Command>"C:\Program Files\Apache Software Foundation\Apache2.4\htdocs\start.bat"</Command>
    </Exec>
  </Actions>
</Task>
enter code here

YJJcoolcool

Posted 2020-02-03T10:52:31.977

Reputation: 11

Can you please export the task from task scheduler and paste the contents of the XML file produced into your question. Feel free to remove the values for "Author" & UserID from the XML so you are not exposing any personal details. – CraftyB – 2020-02-03T11:50:51.517

@CraftyB Here, I added the XML file. – YJJcoolcool – 2020-02-03T12:18:42.703

What is the behaviour of "start.bat" when manually ran, does it close the window when its finished or does it stay open so that the service is kept alive? Does it require any user input? What does the history tab in task scheduler show when it has failed (is there an entry when its failed?). – CraftyB – 2020-02-03T12:50:22.963

When manually ran, yes it closes when it finishes. No user input required. The history tab shows nothing. – YJJcoolcool – 2020-02-03T13:52:04.740

No answers