GFI Software

Welcome to the GFI Software community forum! For support please open a ticket from https://support.gfi.com.

Home » GFI User Forums » Kerio Control » How to : Create cron job to restart automatically (Create a cron job to restart automatically every night)
How to : Create cron job to restart automatically [message #148107] Tue, 12 May 2020 20:27 Go to next message
jcfrig is currently offline  jcfrig
Messages: 3
Registered: March 2020
Hi everyone,

I know that rebooting the Kerio Control machine every night is not the best way to use this firewall but for our needs it was the best thing to do. The only solution I found in here was to use command via SSH from a second computer. This solution was not good for us as we would have to check 2 computers for a simple job. Also, it requires that we keep the SSH to be enable permanently and this we didn't want this too.

So, it took me a couple of hours to find out how to do it, here is a little how to (there is probably a better way to do this, but ... ) for medium Linux users like me:

In order to access Cron jobs on Kerio Control server:

Enabling SSH connection in Kerio Control:
In the web interface, in the status tab (the 4 bars), click on "System Health" holding the "shift" key.
Click on the "enable SSH" button.
confirm.

Set the cron job:
In putty (or other SSH)
Log in to server via SSH (root and KC password)
Type the following commands:
/bin/bash
export EDITOR=/usr/bin/vim
crontab -e

in vim, edit the cron jobs (in this case, I needed the reboot the machine every night)
0 2 * * * root /sbin/reboot now

press escape
:wq to save and quit

type "exit" to quit the root session

Don't forget to disable SSH connection in Kerio Control:
In the web interface, in the status tab (the 4 bars), click on "System Health" holding the "shift" key.
Click on the "disable SSH" button.
confirm.

Hope this will help.
Re: How to : Create cron job to restart automatically [message #148114 is a reply to message #148107] Thu, 14 May 2020 12:41 Go to previous messageGo to next message
PPG is currently offline  PPG
Messages: 184
Registered: February 2010
Is this persistent after new updates?
Re: How to : Create cron job to restart automatically [message #148118 is a reply to message #148114] Fri, 15 May 2020 06:31 Go to previous messageGo to next message
jcfrig is currently offline  jcfrig
Messages: 3
Registered: March 2020
Honestly, I have no idea. I would say yes as it's a linux function. The only thing would be if the update deactivates cron, it could be a problem. I'm gonna tell you if it is on the next update. Smile
Re: How to : Create cron job to restart automatically [message #152724 is a reply to message #148107] Thu, 22 September 2022 09:16 Go to previous messageGo to next message
sma7 is currently offline  sma7
Messages: 3
Registered: November 2021
jcfrig wrote on Tue, 12 May 2020 20:27
Hi everyone,

I know that rebooting the Kerio Control machine every night is not the best way to use this firewall but for our needs it was the best thing to do. The only solution I found in here was to use command via SSH from a second computer. This solution was not good for us as we would have to check 2 computers for a simple job. Also, it requires that we keep the SSH to be enable permanently and this we didn't want this too.

So, it took me a couple of hours to find out how to do it, here is a little how to (there is probably a better way to do this, but ... ) for medium Linux users like me:

In order to access Cron jobs on Kerio Control server:

Enabling SSH connection in Kerio Control:
In the web interface, in the status tab (the 4 bars), click on "System Health" holding the "shift" key.
Click on the "enable SSH" button.
confirm.

Set the cron job:
In putty (or other SSH)
Log in to server via SSH (root and KC password)
Type the following commands:
/bin/bash
export EDITOR=/usr/bin/vim
crontab -e

in vim, edit the cron jobs (in this case, I needed the reboot the machine every night)
0 2 * * * root /sbin/reboot now

press escape
:wq to save and quit

type "exit" to quit the root session

Don't forget to disable SSH connection in Kerio Control:
In the web interface, in the status tab (the 4 bars), click on "System Health" holding the "shift" key.
Click on the "disable SSH" button.
confirm.

Hope this will help.
does not work
Re: How to : Create cron job to restart automatically [message #152750 is a reply to message #152724] Mon, 26 September 2022 08:55 Go to previous messageGo to next message
nanalyly072@gmail.com is currently offline  nanalyly072@gmail.com
Messages: 1
Registered: September 2022
There are many reasons why you might want to restart your server at a certain time. For example, you might want to restart the server after a major update or after a bug fix. You can also use cron job to restart your server automatically at a certain time.
nerdle
Re: How to : Create cron job to restart automatically [message #152772 is a reply to message #148107] Wed, 28 September 2022 20:53 Go to previous message
tverweij is currently offline  tverweij
Messages: 75
Registered: March 2010
Location: Curacao
Thanks for this info!

Edit: but it did not work - the firewall did not restart ....
Any suggestions?

[Updated on: Thu, 29 September 2022 14:40]

Report message to a moderator

Previous Topic: Kerio as VPN Client
Next Topic: Reverse Proxy Too Many Redirects
Goto Forum:
  


Current Time: Wed Jun 07 16:34:02 CEST 2023

Total time taken to generate the page: 0.02900 seconds