<?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 Re: Perform scheduled scripted tasks on SMB devices without crond in Spark Firewall (SMB)</title>
    <link>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Perform-scheduled-scripted-tasks-on-SMB-devices-without-crond/m-p/79157#M3298</link>
    <description>Am curious if this survives an upgrade &lt;span class="lia-unicode-emoji" title=":thinking_face:"&gt;🤔&lt;/span&gt;</description>
    <pubDate>Sat, 21 Mar 2020 23:04:11 GMT</pubDate>
    <dc:creator>PhoneBoy</dc:creator>
    <dc:date>2020-03-21T23:04:11Z</dc:date>
    <item>
      <title>Perform scheduled scripted tasks on SMB devices without crond</title>
      <link>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Perform-scheduled-scripted-tasks-on-SMB-devices-without-crond/m-p/78676#M3283</link>
      <description>&lt;P&gt;In my post&amp;nbsp;&lt;SPAN&gt;&lt;A href="https://community.checkpoint.com/t5/SMB-Appliances-and-SMP/Perform-scheduled-scripted-tasks-on-SMB-devices-without-using/m-p/40054" target="_self"&gt;Perform scheduled scripted tasks on SMB devices without using crond&lt;/A&gt;, tasks on SMB were performed using a remote device. Another possible solution for &lt;STRONG&gt;11xx/6x0 SMBs&lt;/STRONG&gt; is &lt;EM&gt;/pfrm2.0/etc/userScript&amp;nbsp;&lt;/EM&gt;(see sk52520). Started at boot time, it can do a lot for us ! Here, it will reboot the device at a regular time:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;date &amp;gt;&amp;gt; /pfrm2.0/etc/lastReboot&amp;amp;
ln -s /bin/busybox /bin/crond
mkdir -p /var/spool/cron/crontabs/
/bin/crond
echo '0 1 * * 0 shutdown -r -t secs 10080 time now&amp;amp;' &amp;gt;&amp;gt; /var/spool/cron/crontabs/root
chmod 600 /var/spool/cron/crontabs/root&lt;/LI-CODE&gt;
&lt;P&gt;In the first line we keep log; then we create a link &lt;EM&gt;crond&lt;/EM&gt;&amp;nbsp;and its&amp;nbsp;&lt;I&gt;crontabs&lt;/I&gt;. Now we can call&amp;nbsp;&lt;EM&gt;crond&amp;nbsp;&lt;/EM&gt;and create the crontab with correct access rights. Alternatively, you could run something like the following in &lt;EM&gt;userScript&lt;/EM&gt;:&lt;/P&gt;
&lt;LI-CODE lang="java"&gt;while true; do if [ "$(date +%H)" == "2" ]; then echo y | reboot; fi; sleep 3600; done&lt;/LI-CODE&gt;
&lt;P&gt;Both methods end with one more process running on the SMB - in the first, many regular jobs can be defined.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2020 11:51:31 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Perform-scheduled-scripted-tasks-on-SMB-devices-without-crond/m-p/78676#M3283</guid>
      <dc:creator>G_W_Albrecht</dc:creator>
      <dc:date>2020-03-18T11:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: Perform scheduled scripted tasks on SMB devices without crond</title>
      <link>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Perform-scheduled-scripted-tasks-on-SMB-devices-without-crond/m-p/79036#M3291</link>
      <description>&lt;P&gt;Nice write up. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Mar 2020 19:51:53 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Perform-scheduled-scripted-tasks-on-SMB-devices-without-crond/m-p/79036#M3291</guid>
      <dc:creator>John_Fleming</dc:creator>
      <dc:date>2020-03-20T19:51:53Z</dc:date>
    </item>
    <item>
      <title>Re: Perform scheduled scripted tasks on SMB devices without crond</title>
      <link>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Perform-scheduled-scripted-tasks-on-SMB-devices-without-crond/m-p/79157#M3298</link>
      <description>Am curious if this survives an upgrade &lt;span class="lia-unicode-emoji" title=":thinking_face:"&gt;🤔&lt;/span&gt;</description>
      <pubDate>Sat, 21 Mar 2020 23:04:11 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Perform-scheduled-scripted-tasks-on-SMB-devices-without-crond/m-p/79157#M3298</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2020-03-21T23:04:11Z</dc:date>
    </item>
    <item>
      <title>Re: Perform scheduled scripted tasks on SMB devices without crond</title>
      <link>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Perform-scheduled-scripted-tasks-on-SMB-devices-without-crond/m-p/79386#M3309</link>
      <description>&lt;P&gt;Should be. That file is kept during upgrades. See below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[Expert@fw]# pwd&lt;BR /&gt;/pfrm2.0/etc&lt;BR /&gt;[Expert@fw]# egrep userScript *&lt;BR /&gt;additional_settings_file_list:/pfrm2.0/etc/userScript&lt;BR /&gt;[Expert@fw]# cd&amp;nbsp;/pfrm2.0/bin&lt;/P&gt;&lt;P&gt;[Expert@fw]# egrep additional_settings_file_list *&lt;BR /&gt;image_common.sh:ADDITIONAL_SETTINGS_LIST_FILE=$ROOTFS_DIR/etc/additional_settings_file_list&lt;BR /&gt;preboot.sh:ADDITIONAL_FILES_LIST=$INACTIVE_MOUNT_DIR/etc/additional_settings_file_list&lt;BR /&gt;restore_default_settings.sh:#delete all the files listed in /pfrm2.0/etc/additional_settings_file_list (which preserved during upgrade) except the /pfrm2.0/etc/*.config files&lt;BR /&gt;restore_default_settings.sh:awk '/^[^#]/ &amp;amp;&amp;amp; ($1 !~ /\/pfrm2.0\/etc\/.*\.config/) { rm -Rf $1 }' /pfrm2.0/etc/additional_settings_file_list&lt;BR /&gt;[Expert@fw]#&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Mar 2020 17:22:11 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Perform-scheduled-scripted-tasks-on-SMB-devices-without-crond/m-p/79386#M3309</guid>
      <dc:creator>John_Fleming</dc:creator>
      <dc:date>2020-03-23T17:22:11Z</dc:date>
    </item>
    <item>
      <title>Re: Perform scheduled scripted tasks on SMB devices without crond</title>
      <link>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Perform-scheduled-scripted-tasks-on-SMB-devices-without-crond/m-p/79399#M3313</link>
      <description>&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt; +1&lt;/P&gt;</description>
      <pubDate>Mon, 23 Mar 2020 18:59:35 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Perform-scheduled-scripted-tasks-on-SMB-devices-without-crond/m-p/79399#M3313</guid>
      <dc:creator>Danny</dc:creator>
      <dc:date>2020-03-23T18:59:35Z</dc:date>
    </item>
  </channel>
</rss>

