Before any scheduled maintenance (e.g. replacement of a defective hard disk) or server relocation, we recommend that you schedule a shut down of your server to avoid data loss.
Please note: If you schedule shutting down the server, it can only be turned back on again by the IONOS Server Customer Support Team.
How to schedule shutting down your server on a scheduled basis:
Log on to the server as an administrator.
Check whether the Screen program is installed on your server, and if it is not, install it. With Screen you can create and manage several virtual console sessions within one terminal. In addition, Screen allows you to record, disconnect and resume sessions at a later time. This has the advantage that your sessions are not terminated by disconnections.
yum update yum install screen
apt-get update apt-get upgrade apt-get install screen
Use the date command to check whether the date and time correspond to the expected time. If this is not the case, you can use the following command to synchronize the time set on the server with the time server of Freie Universität Berlin. Enter the following command:
To specify when to shut down the server, type the following command:
Shut down server in two hours
screen -d -m shutdown -h 120
Shut down the server at a certain time:
screen -d -m shutdown –h hh:mm
screen -d -m shutdown –h 23:00
Shut down the server on a specific day at a specific time:
screen -d -m shutdown -h +$(($(date +%s -d "MM/DD hh:mm YYYY") - $(date +%s) / 60))
screen -d -m shutdown -h +$(($(date +%s -d "03/24 04:30 2017") - $(date +%s) / 60))
Please note: If you restart the server unscheduled before the specified time, you must re-enter these commands.