<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Repctl Start Task using REPCTL command line interface return value always 0 in Qlik Replicate</title>
    <link>https://community.qlik.com/t5/Qlik-Replicate/Repctl-Start-Task-using-REPCTL-command-line-interface-return/m-p/2073637#M6079</link>
    <description>&lt;P&gt;We start task through REPCTL command line interface.The task settings is only open&amp;nbsp;&lt;SPAN&gt;Full Load.Regardless of whether the&amp;nbsp; task reports an error or not, the return value is always 0.We need return other values when task failed.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 22 May 2023 06:57:47 GMT</pubDate>
    <dc:creator>yzh</dc:creator>
    <dc:date>2023-05-22T06:57:47Z</dc:date>
    <item>
      <title>Repctl Start Task using REPCTL command line interface return value always 0</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Repctl-Start-Task-using-REPCTL-command-line-interface-return/m-p/2073637#M6079</link>
      <description>&lt;P&gt;We start task through REPCTL command line interface.The task settings is only open&amp;nbsp;&lt;SPAN&gt;Full Load.Regardless of whether the&amp;nbsp; task reports an error or not, the return value is always 0.We need return other values when task failed.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2023 06:57:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Repctl-Start-Task-using-REPCTL-command-line-interface-return/m-p/2073637#M6079</guid>
      <dc:creator>yzh</dc:creator>
      <dc:date>2023-05-22T06:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: Repctl Start Task using REPCTL command line interface return value always 0</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Repctl-Start-Task-using-REPCTL-command-line-interface-return/m-p/2073655#M6081</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In general, repctl is not&amp;nbsp; the official APIs for using Replicate commands. In order to perform different actions on Replicate using API you should be using the QEM APIs.&amp;nbsp; The QEM API manual includes details on how to run the APIs, which parameters to pass and what are the responses. FYI - below is a link to the relevant QEM documentation:&amp;nbsp;&lt;BR /&gt;&lt;A href="https://help.qlik.com/en-US/enterprise-manager/May2023/Content/EnterpriseManager/EnterpriseManager_APIGuide/Introduction/AEM_Intro.htm" target="_blank"&gt;https://help.qlik.com/en-US/enterprise-manager/May2023/Content/EnterpriseManager/EnterpriseManager_APIGuide/Introduction/AEM_Intro.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Orit&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2023 07:48:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Repctl-Start-Task-using-REPCTL-command-line-interface-return/m-p/2073655#M6081</guid>
      <dc:creator>OritA</dc:creator>
      <dc:date>2023-05-22T07:48:38Z</dc:date>
    </item>
    <item>
      <title>Re: Repctl Start Task using REPCTL command line interface return value always 0</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Repctl-Start-Task-using-REPCTL-command-line-interface-return/m-p/2073675#M6082</link>
      <description>&lt;P&gt;Thanks a lot.I installed QEM.I will try the QEM API.&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2023 08:19:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Repctl-Start-Task-using-REPCTL-command-line-interface-return/m-p/2073675#M6082</guid>
      <dc:creator>yzh</dc:creator>
      <dc:date>2023-05-22T08:19:43Z</dc:date>
    </item>
    <item>
      <title>Re: Repctl Start Task using REPCTL command line interface return value always 0</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Repctl-Start-Task-using-REPCTL-command-line-interface-return/m-p/2073919#M6088</link>
      <description>&lt;P&gt;The Qlik&amp;nbsp; Enterprise Manager API is 'the right way to go' to solve this challenge. Excellent!&lt;/P&gt;
&lt;P&gt;It needs a server to run on, a configuration, and a license though which _might_ be overkill for some environments.&lt;/P&gt;
&lt;P&gt;Indeed the command like REPCTL always return success. My simple explanation for this it is reading a stream of commands without exit on failure for a individual commands. The end of the stream is an implicit or explicit 'exit' and&amp;nbsp; that yes the final 'exit' command&amp;nbsp; is successful &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;But as it reads that stream of input commands ( Connect; execute this; execute that... ) is produces REPCMD.LOG.&lt;/P&gt;
&lt;P&gt;You _could_ solve the status issue by reading that log and finding out what worked (&lt;STRONG&gt;command] Succeeded&lt;/STRONG&gt;), what did not. I'm not saying you should, but you could. You need to deal with REPCMD.LOG anyway. It get's produced (after renaming the prior) over and over, and you really want you scripts to clean them up if they do not provide unexpected information.&lt;/P&gt;
&lt;P&gt;Or you could follow up the 'start' (execute) command with a 'gettaskstatus' to ask whether the status is expected - RUNNING, STARTING and whether the times like 'full_load_start_time' are after the start time just now.&lt;/P&gt;
&lt;P&gt;Here is how I once (before QEM-API) dealt with the REPCTL challenge in Powershell&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Function CheckRepctlSucceeded ([string[]] $repctl_output, [int] $command_count) 
{
  $log = $logs + '\repcmd.log'
  $bottom_line = ($repctl_output -match 'command] Succeeded').count -1 # Discount for connect/quit
  Write-Verbose "Bottom Line $bottom_line, expected $command_count"
  if ($bottom_line -eq $command_count) {
    if (Test-Path $log) { Remove-Item $log }
  } else {
    write-output "******************** REPCTL OUTPUT ********************" 
    write-output $repctl_output
    write-output "******************** REPCMD.LOG    ********************" 
    Get-Content $log
    write-output "*******************************************************" 
    throw "Only $bottom_line Commands out of $command_count Succeeded"
  }
}
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hein.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2023 14:32:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Repctl-Start-Task-using-REPCTL-command-line-interface-return/m-p/2073919#M6088</guid>
      <dc:creator>Heinvandenheuvel</dc:creator>
      <dc:date>2023-05-22T14:32:48Z</dc:date>
    </item>
  </channel>
</rss>

