<?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 Perform scheduled scripted tasks on SMB devices without using crond in Spark Firewall (SMB)</title>
    <link>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Perform-scheduled-scripted-tasks-on-SMB-devices-without-using/m-p/40054#M1634</link>
    <description>&lt;P&gt;Scripting was a weak point of SMB devices until firmware version R77.20.80: You can easily perform scripted tasks after each boot process (see &lt;EM&gt;sk52520&amp;nbsp;How to run commands at boot on an SG80/600/700/1100/1400/1200R -- UserScript&lt;/EM&gt; for details), but no cron job was possible as &lt;EM&gt;crond&lt;/EM&gt; did not run in GAiA Embedded (although the command &lt;EM&gt;crontab&lt;/EM&gt; exists, it was unusable). There was a procedure to enable &lt;EM&gt;crond&lt;/EM&gt; (&lt;A class="link-titled" title="http://blog.spikefishsolutions.com/2016/04/enabling-cron-scheduling-services-on.html" href="http://blog.spikefishsolutions.com/2016/04/enabling-cron-scheduling-services-on.html" target="_blank" rel="noopener"&gt;Spikefish Solutions Blog: Enabling cron, the scheduling service on 600 / 700 / 1100 / 1200R&lt;/A&gt;) if really needed. Since R77.20.80, crond is running, see the details in &lt;A href="https://community.checkpoint.com/docs/DOC-3046-r772080-cpdiag-and-crond" target="_blank" rel="noopener"&gt;R77.20.80, cpdiag and crond&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;But e.g. to issue a scripted reboot every two weeks at a certain time, we can also trigger the script over a SSH connection from another device. Details can be found in &lt;A class="cp_link sc_ellipsis" style="max-width: 840px;" href="https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&amp;amp;solutionid=sk106836&amp;amp;partition=Advanced&amp;amp;product=Small" target="_blank"&gt;sk106836: &lt;STRONG&gt;How&lt;/STRONG&gt; to &lt;STRONG&gt;configure&lt;/STRONG&gt; &lt;STRONG&gt;SSH&lt;/STRONG&gt; &lt;STRONG&gt;authentication&lt;/STRONG&gt; &lt;STRONG&gt;using&lt;/STRONG&gt; &lt;STRONG&gt;RSA&lt;/STRONG&gt; &lt;STRONG&gt;key&lt;/STRONG&gt; &lt;STRONG&gt;files&lt;/STRONG&gt; on &lt;STRONG&gt;Security&lt;/STRONG&gt; &lt;STRONG&gt;Gateway&lt;/STRONG&gt; &lt;STRONG&gt;80&lt;/STRONG&gt; / &lt;STRONG&gt;600&lt;/STRONG&gt; / &lt;STRONG&gt;700&lt;/STRONG&gt; / &lt;STRONG&gt;1100&lt;/STRONG&gt; / &lt;STRONG&gt;1200R&lt;/STRONG&gt;/ &lt;STRONG&gt;1400&lt;/STRONG&gt; &lt;STRONG&gt;appliances&lt;/STRONG&gt;&lt;/A&gt;. Remember to keep the passphrase empty when generating the key pair ! First step is to run #&lt;EM&gt; bashUser on&lt;/EM&gt; while in expert mode to enable login directly into expert mode and WinSCP access. On the SMB box, we then create the file &lt;EM&gt;/pfrm2.0/etc/myreb.sh&lt;/EM&gt;&lt;SPAN style="font-size: 11px;"&gt; :&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;#!/bin/bash -f&lt;BR /&gt;source /fwtmp/opt/fw1/tmp/.CPprofile.sh&lt;BR /&gt;date &amp;gt;&amp;gt; /pfrm2.0/etc/lastReboot&lt;BR /&gt;(echo y ) | reboot&lt;/PRE&gt;
&lt;P&gt;The second line is included as good practise and not needed here - but other commands will depend on environment variables set correctly (see &lt;A class="cp_link sc_ellipsis" style="max-width: 840px;" href="https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&amp;amp;solutionid=sk77300&amp;amp;partition=Advanced&amp;amp;product=Security" target="_blank"&gt;sk77300&lt;/A&gt; and &lt;A class="cp_link sc_ellipsis" style="max-width: 840px;" href="https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&amp;amp;solutionid=sk90441&amp;amp;partition=Advanced&amp;amp;product=Security" target="_blank"&gt;sk90441&lt;/A&gt;).&lt;/P&gt;
&lt;P&gt;On the unit that shall issue the command (based on GAiA or Unix) we follow&lt;EM&gt; sk95890 How to configure SSH authentication on Gaia OS using RSA key files&lt;/EM&gt; and create &lt;EM&gt;/home/admin/sshreb.sh&lt;/EM&gt; :&lt;/P&gt;
&lt;PRE&gt;#!/bin/bash -f&lt;CODE&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;CODE&gt;source $CPDIR/tmp/.CPprofile.sh&lt;/CODE&gt;&lt;BR /&gt;ssh -i /home/admin/MyKey ip.x.x.x sh -l ./pfrm2.0/etc/myreb.sh&lt;/PRE&gt;
&lt;P&gt;After first connect per ssh, the script is able to login and perform reboot automatically after being called using cron. This is easy e.g. on a Gaia device (in GAiA WebGUI, see under System Management &amp;gt; Job Scheduler). Such a script can also perform TP Updates automatically, but at different scheduled times for each blade using the &lt;EM&gt;online_update_cmd&lt;/EM&gt; !&lt;/P&gt;</description>
    <pubDate>Fri, 05 Apr 2019 09:55:35 GMT</pubDate>
    <dc:creator>G_W_Albrecht</dc:creator>
    <dc:date>2019-04-05T09:55:35Z</dc:date>
    <item>
      <title>Perform scheduled scripted tasks on SMB devices without using crond</title>
      <link>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Perform-scheduled-scripted-tasks-on-SMB-devices-without-using/m-p/40054#M1634</link>
      <description>&lt;P&gt;Scripting was a weak point of SMB devices until firmware version R77.20.80: You can easily perform scripted tasks after each boot process (see &lt;EM&gt;sk52520&amp;nbsp;How to run commands at boot on an SG80/600/700/1100/1400/1200R -- UserScript&lt;/EM&gt; for details), but no cron job was possible as &lt;EM&gt;crond&lt;/EM&gt; did not run in GAiA Embedded (although the command &lt;EM&gt;crontab&lt;/EM&gt; exists, it was unusable). There was a procedure to enable &lt;EM&gt;crond&lt;/EM&gt; (&lt;A class="link-titled" title="http://blog.spikefishsolutions.com/2016/04/enabling-cron-scheduling-services-on.html" href="http://blog.spikefishsolutions.com/2016/04/enabling-cron-scheduling-services-on.html" target="_blank" rel="noopener"&gt;Spikefish Solutions Blog: Enabling cron, the scheduling service on 600 / 700 / 1100 / 1200R&lt;/A&gt;) if really needed. Since R77.20.80, crond is running, see the details in &lt;A href="https://community.checkpoint.com/docs/DOC-3046-r772080-cpdiag-and-crond" target="_blank" rel="noopener"&gt;R77.20.80, cpdiag and crond&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;But e.g. to issue a scripted reboot every two weeks at a certain time, we can also trigger the script over a SSH connection from another device. Details can be found in &lt;A class="cp_link sc_ellipsis" style="max-width: 840px;" href="https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&amp;amp;solutionid=sk106836&amp;amp;partition=Advanced&amp;amp;product=Small" target="_blank"&gt;sk106836: &lt;STRONG&gt;How&lt;/STRONG&gt; to &lt;STRONG&gt;configure&lt;/STRONG&gt; &lt;STRONG&gt;SSH&lt;/STRONG&gt; &lt;STRONG&gt;authentication&lt;/STRONG&gt; &lt;STRONG&gt;using&lt;/STRONG&gt; &lt;STRONG&gt;RSA&lt;/STRONG&gt; &lt;STRONG&gt;key&lt;/STRONG&gt; &lt;STRONG&gt;files&lt;/STRONG&gt; on &lt;STRONG&gt;Security&lt;/STRONG&gt; &lt;STRONG&gt;Gateway&lt;/STRONG&gt; &lt;STRONG&gt;80&lt;/STRONG&gt; / &lt;STRONG&gt;600&lt;/STRONG&gt; / &lt;STRONG&gt;700&lt;/STRONG&gt; / &lt;STRONG&gt;1100&lt;/STRONG&gt; / &lt;STRONG&gt;1200R&lt;/STRONG&gt;/ &lt;STRONG&gt;1400&lt;/STRONG&gt; &lt;STRONG&gt;appliances&lt;/STRONG&gt;&lt;/A&gt;. Remember to keep the passphrase empty when generating the key pair ! First step is to run #&lt;EM&gt; bashUser on&lt;/EM&gt; while in expert mode to enable login directly into expert mode and WinSCP access. On the SMB box, we then create the file &lt;EM&gt;/pfrm2.0/etc/myreb.sh&lt;/EM&gt;&lt;SPAN style="font-size: 11px;"&gt; :&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;#!/bin/bash -f&lt;BR /&gt;source /fwtmp/opt/fw1/tmp/.CPprofile.sh&lt;BR /&gt;date &amp;gt;&amp;gt; /pfrm2.0/etc/lastReboot&lt;BR /&gt;(echo y ) | reboot&lt;/PRE&gt;
&lt;P&gt;The second line is included as good practise and not needed here - but other commands will depend on environment variables set correctly (see &lt;A class="cp_link sc_ellipsis" style="max-width: 840px;" href="https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&amp;amp;solutionid=sk77300&amp;amp;partition=Advanced&amp;amp;product=Security" target="_blank"&gt;sk77300&lt;/A&gt; and &lt;A class="cp_link sc_ellipsis" style="max-width: 840px;" href="https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&amp;amp;solutionid=sk90441&amp;amp;partition=Advanced&amp;amp;product=Security" target="_blank"&gt;sk90441&lt;/A&gt;).&lt;/P&gt;
&lt;P&gt;On the unit that shall issue the command (based on GAiA or Unix) we follow&lt;EM&gt; sk95890 How to configure SSH authentication on Gaia OS using RSA key files&lt;/EM&gt; and create &lt;EM&gt;/home/admin/sshreb.sh&lt;/EM&gt; :&lt;/P&gt;
&lt;PRE&gt;#!/bin/bash -f&lt;CODE&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;CODE&gt;source $CPDIR/tmp/.CPprofile.sh&lt;/CODE&gt;&lt;BR /&gt;ssh -i /home/admin/MyKey ip.x.x.x sh -l ./pfrm2.0/etc/myreb.sh&lt;/PRE&gt;
&lt;P&gt;After first connect per ssh, the script is able to login and perform reboot automatically after being called using cron. This is easy e.g. on a Gaia device (in GAiA WebGUI, see under System Management &amp;gt; Job Scheduler). Such a script can also perform TP Updates automatically, but at different scheduled times for each blade using the &lt;EM&gt;online_update_cmd&lt;/EM&gt; !&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2019 09:55:35 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Perform-scheduled-scripted-tasks-on-SMB-devices-without-using/m-p/40054#M1634</guid>
      <dc:creator>G_W_Albrecht</dc:creator>
      <dc:date>2019-04-05T09:55:35Z</dc:date>
    </item>
    <item>
      <title>Re: Perform scheduled scripted tasks on SMB devices</title>
      <link>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Perform-scheduled-scripted-tasks-on-SMB-devices-without-using/m-p/40055#M1635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for posting this.&amp;nbsp; Two things to note...&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I had to specify my user in my ssh command (&lt;A href="mailto:user@x.x.x.x"&gt;user@x.x.x.x&lt;/A&gt;)&lt;/LI&gt;&lt;LI&gt;Since this is SMB, I had to run &lt;SPAN style="color: #0000ff;"&gt;&lt;EM&gt;bashUser on&lt;/EM&gt; &lt;/SPAN&gt;while in expert mode to enable login directly into expert mode to run my script&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From the&amp;nbsp;Check Point 600/700/1100/1200R/1400 Appliance R77.20.75 CLI Guide:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;You can enable login directly to expert mode. To do this:&lt;/P&gt;&lt;P&gt;• Login to Expert mode using the "Expert" password.&lt;/P&gt;&lt;P&gt;• Run the command bashUser on&lt;/P&gt;&lt;P&gt;• You will now always login directly to expert mode (this mode is not deleted during reboot)&lt;/P&gt;&lt;P&gt;• To turn this mode off, run the command bashUser off&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Mar 2018 19:42:07 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Perform-scheduled-scripted-tasks-on-SMB-devices-without-using/m-p/40055#M1635</guid>
      <dc:creator>Brian_Deutmeyer</dc:creator>
      <dc:date>2018-03-02T19:42:07Z</dc:date>
    </item>
    <item>
      <title>Re: Perform scheduled scripted tasks on SMB devices</title>
      <link>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Perform-scheduled-scripted-tasks-on-SMB-devices-without-using/m-p/40056#M1636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually, it is possible to run cron jobs on SMB. I have followed this guide and it works for me very well:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://blog.spikefishsolutions.com/2016/04/enabling-cron-scheduling-services-on.html" title="http://blog.spikefishsolutions.com/2016/04/enabling-cron-scheduling-services-on.html"&gt;Spikefish Solutions Blog: Enabling cron, the scheduling service on 600 / 700 / 1100 / 1200R&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Mar 2018 17:51:26 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Perform-scheduled-scripted-tasks-on-SMB-devices-without-using/m-p/40056#M1636</guid>
      <dc:creator>HristoGrigorov</dc:creator>
      <dc:date>2018-03-03T17:51:26Z</dc:date>
    </item>
    <item>
      <title>Re: Perform scheduled scripted tasks on SMB devices</title>
      <link>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Perform-scheduled-scripted-tasks-on-SMB-devices-without-using/m-p/40057#M1637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, that is true - afair you have to ssh connect manually for one time, then you can use the script. For GUI based guys like me, bashUser on is the first command issued on every SMB unit so we can use WinSCP &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://community.checkpoint.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Mar 2018 08:20:49 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Perform-scheduled-scripted-tasks-on-SMB-devices-without-using/m-p/40057#M1637</guid>
      <dc:creator>G_W_Albrecht</dc:creator>
      <dc:date>2018-03-05T08:20:49Z</dc:date>
    </item>
    <item>
      <title>Re: Perform scheduled scripted tasks on SMB devices</title>
      <link>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Perform-scheduled-scripted-tasks-on-SMB-devices-without-using/m-p/40058#M1638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That really is wild - i did not search for a cron binary, and crontab, as seen in the document, has no memory... We can see that this is a rather downsized busybox system, and that is understandable if we think of SG-80 or 600 models hardware capabilities &lt;IMG src="https://community.checkpoint.com/legacyfs/online/checkpoint/emoticons/plain.png" /&gt;. To create a symlink, a directory, call crond and write the crontab file on boot is working ok, but for me does not feel very comfortable. With current hardware, the need to trigger TP updates at different times - opposed to internaly scheduling all updates for the same time - is mostly gone, and scheduled backup works perfectly for me since a long time, and without any cron job...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Mar 2018 08:35:05 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Perform-scheduled-scripted-tasks-on-SMB-devices-without-using/m-p/40058#M1638</guid>
      <dc:creator>G_W_Albrecht</dc:creator>
      <dc:date>2018-03-05T08:35:05Z</dc:date>
    </item>
    <item>
      <title>Re: Perform scheduled scripted tasks on SMB devices</title>
      <link>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Perform-scheduled-scripted-tasks-on-SMB-devices-without-using/m-p/40059#M1639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have changed the document by adding details from the comments - thank you all for them !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Mar 2018 12:39:51 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Perform-scheduled-scripted-tasks-on-SMB-devices-without-using/m-p/40059#M1639</guid>
      <dc:creator>G_W_Albrecht</dc:creator>
      <dc:date>2018-03-05T12:39:51Z</dc:date>
    </item>
    <item>
      <title>Re: Perform scheduled scripted tasks on SMB devices without using crond</title>
      <link>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Perform-scheduled-scripted-tasks-on-SMB-devices-without-using/m-p/250339#M12756</link>
      <description>&lt;P&gt;Addition: Second line has changed with newer firmware:&lt;/P&gt;
&lt;PRE&gt;#!/bin/bash -f&lt;BR /&gt;source /opt/fw1/tmp/.CPprofile.sh&amp;nbsp;&lt;/PRE&gt;</description>
      <pubDate>Mon, 02 Jun 2025 10:40:53 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Perform-scheduled-scripted-tasks-on-SMB-devices-without-using/m-p/250339#M12756</guid>
      <dc:creator>G_W_Albrecht</dc:creator>
      <dc:date>2025-06-02T10:40:53Z</dc:date>
    </item>
  </channel>
</rss>

