<?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 mgmt_cli --sync false in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-sync-false/m-p/269467#M9365</link>
    <description>&lt;P&gt;Today, I learned of an option in mgmt_cli that might be useful in scripting contexts: --sync false.&lt;/P&gt;
&lt;P&gt;According to the CLI help:&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;[--sync] {true|false}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Synchronous execution of task - commands that generate the task will wait until the task is finished.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Default {true}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Environment variable: MGMT_CLI_SYNC&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;In practical terms, this suggests that for calls that would normally return a result right away, you'll get a task-id that can be monitored with &lt;A href="https://sc1.checkpoint.com/documents/latest/APIs/index.html#cli/show-task~v2.1%20" target="_self"&gt;show-task&lt;/A&gt;.&lt;BR /&gt;Where it is the most useful is in install-policy, which, when called with mgmt_cli, acts synchronously (i.e. does not complete until policy is installed).&amp;nbsp;&lt;/P&gt;
&lt;P class="p1 lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="s1"&gt;[Expert@MyMgmt:0]# &lt;STRONG&gt;mgmt_cli -r true install-policy policy-package "Standard"&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="p1 lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="s1"&gt;---------------------------------------------&lt;BR /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="s1"&gt;Time: [11:17:54] 2/2/2026&lt;BR /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="s1"&gt;---------------------------------------------&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="p1 lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="s1"&gt;"Policy installation - Standard"&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;in progress&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;(40%)&amp;nbsp;&lt;BR /&gt;...&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;In investigating this issue further, though, I realized that install-policy returns a task-id by default if called via Web API.&lt;BR /&gt;I confirmed it using the below:&lt;/P&gt;
&lt;P class="p1 lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="s1"&gt;[Expert@MyMgmt:0]#&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN class="s1"&gt;curl_cli -k &lt;A href="https://127.0.0.1/web_api/install-policy" target="_blank" rel="noopener"&gt;https://127.0.0.1/web_api/install-policy&lt;/A&gt; -H 'Content-Type: application/json' -H 'X-chkp-sid: my-session-id' --request POST -d ' { "policy-package" : "Standard" }'&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="p1 lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="s1"&gt;{&lt;BR /&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;"task-id" : "b0c3cf65-b54f-4647-9c03-cf84077b32e1"&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;}&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;If I try to use --sync false with, say, run-script, you will get a "stuck" task that never completes until reboot:&lt;/P&gt;
&lt;P class="p1 lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="s1"&gt;[Expert@MyMgmt:0]# &lt;STRONG&gt;mgmt_cli -r true show-task task-id "f58349ae-4289-4f7c-b4ec-1c548be0a89a"&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="s1"&gt;tasks: &lt;BR /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="s1"&gt;- task-id: "f58349ae-4289-4f7c-b4ec-1c548be0a89a"&lt;BR /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;task-name: "MyMgmt - Test"&lt;BR /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;status: "in progress"&lt;BR /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;progress-percentage: 10&lt;BR /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;suppressed: false&lt;BR /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;comments: "In Progress..."&lt;BR /&gt;...&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="p1"&gt;Which suggests that --sync false is designed only for install-policy and might not work for other API calls.&lt;/P&gt;
&lt;P class="p1"&gt;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/37502"&gt;@Omer_Kleinstern&lt;/a&gt;&amp;nbsp;at the very least we might want to update the docs for mgmt_cli to mention it is actually synchronous with install-policy.&lt;/P&gt;</description>
    <pubDate>Mon, 02 Feb 2026 18:27:47 GMT</pubDate>
    <dc:creator>PhoneBoy</dc:creator>
    <dc:date>2026-02-02T18:27:47Z</dc:date>
    <item>
      <title>mgmt_cli --sync false</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-sync-false/m-p/269467#M9365</link>
      <description>&lt;P&gt;Today, I learned of an option in mgmt_cli that might be useful in scripting contexts: --sync false.&lt;/P&gt;
&lt;P&gt;According to the CLI help:&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;[--sync] {true|false}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Synchronous execution of task - commands that generate the task will wait until the task is finished.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Default {true}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Environment variable: MGMT_CLI_SYNC&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;In practical terms, this suggests that for calls that would normally return a result right away, you'll get a task-id that can be monitored with &lt;A href="https://sc1.checkpoint.com/documents/latest/APIs/index.html#cli/show-task~v2.1%20" target="_self"&gt;show-task&lt;/A&gt;.&lt;BR /&gt;Where it is the most useful is in install-policy, which, when called with mgmt_cli, acts synchronously (i.e. does not complete until policy is installed).&amp;nbsp;&lt;/P&gt;
&lt;P class="p1 lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="s1"&gt;[Expert@MyMgmt:0]# &lt;STRONG&gt;mgmt_cli -r true install-policy policy-package "Standard"&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="p1 lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="s1"&gt;---------------------------------------------&lt;BR /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="s1"&gt;Time: [11:17:54] 2/2/2026&lt;BR /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="s1"&gt;---------------------------------------------&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="p1 lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="s1"&gt;"Policy installation - Standard"&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;in progress&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;(40%)&amp;nbsp;&lt;BR /&gt;...&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;In investigating this issue further, though, I realized that install-policy returns a task-id by default if called via Web API.&lt;BR /&gt;I confirmed it using the below:&lt;/P&gt;
&lt;P class="p1 lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="s1"&gt;[Expert@MyMgmt:0]#&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN class="s1"&gt;curl_cli -k &lt;A href="https://127.0.0.1/web_api/install-policy" target="_blank" rel="noopener"&gt;https://127.0.0.1/web_api/install-policy&lt;/A&gt; -H 'Content-Type: application/json' -H 'X-chkp-sid: my-session-id' --request POST -d ' { "policy-package" : "Standard" }'&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="p1 lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="s1"&gt;{&lt;BR /&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;"task-id" : "b0c3cf65-b54f-4647-9c03-cf84077b32e1"&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;}&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;If I try to use --sync false with, say, run-script, you will get a "stuck" task that never completes until reboot:&lt;/P&gt;
&lt;P class="p1 lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="s1"&gt;[Expert@MyMgmt:0]# &lt;STRONG&gt;mgmt_cli -r true show-task task-id "f58349ae-4289-4f7c-b4ec-1c548be0a89a"&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="s1"&gt;tasks: &lt;BR /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="s1"&gt;- task-id: "f58349ae-4289-4f7c-b4ec-1c548be0a89a"&lt;BR /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;task-name: "MyMgmt - Test"&lt;BR /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;status: "in progress"&lt;BR /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;progress-percentage: 10&lt;BR /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;suppressed: false&lt;BR /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;comments: "In Progress..."&lt;BR /&gt;...&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="p1"&gt;Which suggests that --sync false is designed only for install-policy and might not work for other API calls.&lt;/P&gt;
&lt;P class="p1"&gt;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/37502"&gt;@Omer_Kleinstern&lt;/a&gt;&amp;nbsp;at the very least we might want to update the docs for mgmt_cli to mention it is actually synchronous with install-policy.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Feb 2026 18:27:47 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-sync-false/m-p/269467#M9365</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2026-02-02T18:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: mgmt_cli --sync false</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-sync-false/m-p/269468#M9366</link>
      <description>&lt;P&gt;Good to know!&lt;/P&gt;</description>
      <pubDate>Mon, 02 Feb 2026 18:11:37 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-sync-false/m-p/269468#M9366</guid>
      <dc:creator>the_rock</dc:creator>
      <dc:date>2026-02-02T18:11:37Z</dc:date>
    </item>
    <item>
      <title>Re: mgmt_cli --sync false</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-sync-false/m-p/269472#M9367</link>
      <description>&lt;P&gt;I don't expect a lot of people to run into it either.&lt;BR /&gt;Having said that, in case someone asks again, it's now documented.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Feb 2026 18:31:22 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-sync-false/m-p/269472#M9367</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2026-02-02T18:31:22Z</dc:date>
    </item>
    <item>
      <title>Re: mgmt_cli --sync false</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-sync-false/m-p/269478#M9368</link>
      <description>&lt;P&gt;You never know, definitely good to be aware.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Feb 2026 18:40:22 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-sync-false/m-p/269478#M9368</guid>
      <dc:creator>the_rock</dc:creator>
      <dc:date>2026-02-02T18:40:22Z</dc:date>
    </item>
    <item>
      <title>Re: mgmt_cli --sync false</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-sync-false/m-p/269587#M9369</link>
      <description>&lt;P&gt;The&amp;nbsp;switch "--sync" is supported on all API commands that return a task.&lt;/P&gt;
&lt;P&gt;There is also the&amp;nbsp;switch "--sync-frequency" for cases where the duration of the task is long and you want to reduce the&amp;nbsp;number of show-task commands that run.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Feb 2026 15:57:30 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-sync-false/m-p/269587#M9369</guid>
      <dc:creator>Omer_Kleinstern</dc:creator>
      <dc:date>2026-02-03T15:57:30Z</dc:date>
    </item>
    <item>
      <title>Re: mgmt_cli --sync false</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-sync-false/m-p/269597#M9370</link>
      <description>&lt;P&gt;As run-script is not an API call that returns a task-id, it explains the behavior.&lt;BR /&gt;Curious why run-script doesn't return a task-id as it would allow for longer-running scripts to be triggered via the API call.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Feb 2026 18:40:35 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-sync-false/m-p/269597#M9370</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2026-02-03T18:40:35Z</dc:date>
    </item>
  </channel>
</rss>

