How can I shutdown a RHEL server at 06:45 tomorrow morning?

You should use the at command:

$ sudo at 6:45
[sudo] password for root: 
warning: commands will be executed using /bin/sh
at> poweroff
at> <EOT>

Don't type the <EOT>, but press Ctrl+D at the second at> prompt.

The significant advantage of using at over using shutdown with a TIME argument, is that it involves real, persistent, scheduling, and works even if the machine is rebooted in the intermediate time period. The shutdown TIME will not restart automatically in such an event, which might cause a double ungraceful power off if the reboot in the intermediate time period was not anticipated.


You can use shutdown:

sudo shutdown -h  06:45 &

And to check it:

ps -aux | grep shutdown

If you want to cancel it:

sudo shutdown -c

This assumes of course that the shutdown time has already passed.