The new version server also has a built-in restart option btw
You can just type "restart" into console, or into the ingame console to issue a restart.
When typing the command into ingame console, you can also add a parameter which describes when the restart will be issued exactly (in seconds). I.e. restart 120 will issue a restart in 120 seconds (2 minutes). This automatically sends multiple messages to all players about the impending restart, and saves the world again before actually performing the restart.
You can also set up an automatic restart via scheduler. Just create a "scheduler.txt" file in the server folder (requires server restart) and add this line, for example: @+12h /restart -> this will restart the server 12 hours after the original start.
Alternatively you can also set fixed times for restart, e.g. @6:00 /restart will restart the server every day at 6 am (note that time uses 24 hour format, so if you want a restart at 6 pm, you have to enter "@18:00").
Of course this can't detect crashes unfortunately, so it's definitely recommendable to implement some additional handling as described by james1bow