man login
If the user is not root, and if /etc/nologin exists, the contents of
this file are printed to the screen, and the login is terminated.
This is typically used to prevent logins when the system is being
taken down.
crontab:
0 10 * * * rm -f /etc/nologin
0 18 * * * ln /etc/nologin.bak /etc/nologin