<?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 Cronjob Not Working in Firewall and Security Management</title>
    <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Cronjob-Not-Working/m-p/31142#M2482</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I want to setup a couple cronjobs to run a few bash scripts on my gateways. One being the healthcheck.sh. I then created an export script to take the two files it creates and export it to an FTP server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both of my shell scripts can be executed manually but when I try to setup cronjobs, they don't work. I created a user called jobuser to execute these.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[Expert@host]# crontab -u jobuser -l&lt;BR /&gt;0 1 1 1-12 * /home/admin/healthcheck.sh&lt;BR /&gt;0 2 1 1-12 * /home/admin/healthcheckexport.sh&lt;BR /&gt;25 3 * * * /home/admin/healthcheckexport.sh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here you can see I have two schedules, one to run the healthcheck first then to run the export, then I have a third that I was just testing with live to see why or why it isnt working.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After this I also created a healthjob cron in etc/cron.d and chmod 664 to give it proper permissions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Referencing&amp;nbsp;&lt;A class="link-titled" href="https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&amp;amp;solutionid=sk97700" title="https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&amp;amp;solutionid=sk97700"&gt;How to create a cron job on SecurePlatform OS that runs every minute&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[Expert@host]# cd /etc/cron.d/&lt;BR /&gt;[Expert@host]# ls -al&lt;BR /&gt;total 24&lt;BR /&gt;drwx------ 2 admin root 4096 Feb 16 16:55 .&lt;BR /&gt;drwxr-xr-x 47 admin root 12288 Feb 13 08:41 ..&lt;BR /&gt;-rw-rw-r--&amp;nbsp; 1 admin root 51 Feb 16 16:55 healthjob&lt;BR /&gt;-rw-r--r-- 1 admin root 188 Jan 31 2008 sysstat&lt;BR /&gt;[Expert@host]# cat healthjob&lt;BR /&gt;56 16 * * * root /home/admin/healthcheckexport.sh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I restart the cron service and tail /var/log/cron I get BAD FILE MODE which just means permission issue as far as I know in the unix. I even chmod to 777 for fun and no luck.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Feb 20 10:50:15 2018&amp;nbsp;host crond[31840]: (*system*) BAD FILE MODE (/etc/cron.d/healthjob)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also made sure that both my scripts start with !#bin/bash I've also tried adding -f -x but that isn't recognized&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Feb 2018 15:53:50 GMT</pubDate>
    <dc:creator>Kyle_Chickering</dc:creator>
    <dc:date>2018-02-20T15:53:50Z</dc:date>
    <item>
      <title>Cronjob Not Working</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Cronjob-Not-Working/m-p/31142#M2482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I want to setup a couple cronjobs to run a few bash scripts on my gateways. One being the healthcheck.sh. I then created an export script to take the two files it creates and export it to an FTP server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both of my shell scripts can be executed manually but when I try to setup cronjobs, they don't work. I created a user called jobuser to execute these.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[Expert@host]# crontab -u jobuser -l&lt;BR /&gt;0 1 1 1-12 * /home/admin/healthcheck.sh&lt;BR /&gt;0 2 1 1-12 * /home/admin/healthcheckexport.sh&lt;BR /&gt;25 3 * * * /home/admin/healthcheckexport.sh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here you can see I have two schedules, one to run the healthcheck first then to run the export, then I have a third that I was just testing with live to see why or why it isnt working.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After this I also created a healthjob cron in etc/cron.d and chmod 664 to give it proper permissions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Referencing&amp;nbsp;&lt;A class="link-titled" href="https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&amp;amp;solutionid=sk97700" title="https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&amp;amp;solutionid=sk97700"&gt;How to create a cron job on SecurePlatform OS that runs every minute&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[Expert@host]# cd /etc/cron.d/&lt;BR /&gt;[Expert@host]# ls -al&lt;BR /&gt;total 24&lt;BR /&gt;drwx------ 2 admin root 4096 Feb 16 16:55 .&lt;BR /&gt;drwxr-xr-x 47 admin root 12288 Feb 13 08:41 ..&lt;BR /&gt;-rw-rw-r--&amp;nbsp; 1 admin root 51 Feb 16 16:55 healthjob&lt;BR /&gt;-rw-r--r-- 1 admin root 188 Jan 31 2008 sysstat&lt;BR /&gt;[Expert@host]# cat healthjob&lt;BR /&gt;56 16 * * * root /home/admin/healthcheckexport.sh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I restart the cron service and tail /var/log/cron I get BAD FILE MODE which just means permission issue as far as I know in the unix. I even chmod to 777 for fun and no luck.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Feb 20 10:50:15 2018&amp;nbsp;host crond[31840]: (*system*) BAD FILE MODE (/etc/cron.d/healthjob)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also made sure that both my scripts start with !#bin/bash I've also tried adding -f -x but that isn't recognized&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Feb 2018 15:53:50 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Cronjob-Not-Working/m-p/31142#M2482</guid>
      <dc:creator>Kyle_Chickering</dc:creator>
      <dc:date>2018-02-20T15:53:50Z</dc:date>
    </item>
    <item>
      <title>Re: Cronjob Not Working</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Cronjob-Not-Working/m-p/31143#M2483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can test your user permissions with &lt;EM&gt;&lt;STRONG&gt;runuser&lt;/STRONG&gt; &lt;/EM&gt;command. I created a script that can only be executed by admin UID 0 (kasparsz has the same UID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;[Expert@fw1:0]# runuser -l kasparsz /home/kasparsz/test.sh&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;test&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;[Expert@fw1:0]# runuser -l testuser /home/kasparsz/test.sh&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;-bash: /home/kasparsz/test.sh: Permission denied&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Make sure that role that you have associated with this new user has rights to execute scheduled jobs&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Feb 2018 19:45:40 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Cronjob-Not-Working/m-p/31143#M2483</guid>
      <dc:creator>Kaspars_Zibarts</dc:creator>
      <dc:date>2018-02-20T19:45:40Z</dc:date>
    </item>
    <item>
      <title>Re: Cronjob Not Working</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Cronjob-Not-Working/m-p/31144#M2484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kaspars, I ran chmod 777 on both of the scripts I need to run. Every user has access to them. Is there something I'm missing?&lt;A href="https://community.checkpoint.com/migrated-users/47831"&gt;https://community.checkpoint.com/people/kaspa0460ae43-b630-4a72-b063-0a8888fa3bb5&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[Expert@fw1]# runuser -l jobuser /home/admin/healthcheck.sh&lt;BR /&gt;Usage-&lt;BR /&gt;clish [-d DebugLevel -i -l ExtLck -s -o OutFmt { -c Cmd | -f File }]&lt;BR /&gt; -c Cmd ;Single command to execute.&lt;BR /&gt; -d N ;Debug Level in which shell should operate.&lt;BR /&gt; -f File ;File to load configuration from.&lt;BR /&gt; -i ;Ignore cmd failure in batch and continue.&lt;BR /&gt; -l ExtLck ;Use the given lock-id.&lt;BR /&gt; -o OutFmt ;Output format (pretty, xml, structured).&lt;BR /&gt; -s ;Issue 'save' at the end.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Feb 2018 16:14:45 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Cronjob-Not-Working/m-p/31144#M2484</guid>
      <dc:creator>Kyle_Chickering</dc:creator>
      <dc:date>2018-02-21T16:14:45Z</dc:date>
    </item>
    <item>
      <title>Re: Cronjob Not Working</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Cronjob-Not-Working/m-p/31145#M2485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This means means your job user has wrong shell set. Change it to bash instead of clish. In user settings.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Feb 2018 17:41:48 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Cronjob-Not-Working/m-p/31145#M2485</guid>
      <dc:creator>Kaspars_Zibarts</dc:creator>
      <dc:date>2018-02-21T17:41:48Z</dc:date>
    </item>
    <item>
      <title>Re: Cronjob Not Working</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Cronjob-Not-Working/m-p/31146#M2486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, that worked when changing the shell to bash for "jobuser" Missed that part.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Feb 2018 19:29:43 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Cronjob-Not-Working/m-p/31146#M2486</guid>
      <dc:creator>Kyle_Chickering</dc:creator>
      <dc:date>2018-02-21T19:29:43Z</dc:date>
    </item>
    <item>
      <title>Re: Cronjob Not Working</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Cronjob-Not-Working/m-p/31147#M2487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is really more of an &lt;A href="https://community.checkpoint.com/community/infinity-general/appliances-and-gaia?sr=search&amp;amp;searchId=58156239-8c64-43ab-9c0a-55a55e6fff50&amp;amp;searchIndex=0" target="_blank"&gt;https://community.checkpoint.com/community/infinity-general/appliances-and-gaia?sr=search&amp;amp;searchId=58156239-8c64-43ab-9c0a-55a55e6fff50&amp;amp;searchIndex=0&lt;/A&gt;‌ question&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jun 2019 09:17:27 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Cronjob-Not-Working/m-p/31147#M2487</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2019-06-21T09:17:27Z</dc:date>
    </item>
    <item>
      <title>Re: Cronjob Not Working</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Cronjob-Not-Working/m-p/49391#M3688</link>
      <description>&lt;P&gt;Hello Kyle&lt;/P&gt;&lt;P&gt;Can you please share the export script that you have created?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Sun, 31 Mar 2019 23:43:36 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Cronjob-Not-Working/m-p/49391#M3688</guid>
      <dc:creator>venkata_marutur</dc:creator>
      <dc:date>2019-03-31T23:43:36Z</dc:date>
    </item>
  </channel>
</rss>

