How to : Create cron job to restart automatically [message #148107] |
Tue, 12 May 2020 20:27  |
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 #152724 is a reply to message #148107] |
Thu, 22 September 2022 09:16   |
sma7
Messages: 3 Registered: November 2021
|
|
|
|
jcfrig wrote on Tue, 12 May 2020 20:27Hi 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
|
|
|
|
|