-2

I have a CentOS 5 server, I want it to halt DAILY at 21:00 and wake up DAILY at 8:00

For the wake up I did it in the bios, but for the halt I want to configure it through cron. How to do it with SSH?

I'm logged as ROOT, and now I want to pass a command that tells the server to halt EVERYDAY at 21:00.

Thanks.

3

SSH is just a way of logging in. If you are logged in as you say, you don't need SSH anymore.

A command to shutdown is shutdown -h now.

You edit your current user's crontab with crontab -e.

In a user's crontab, the line to execute he above statement should be

0 21 * * * /sbin/shutdown -h now
  • No, SSH is just the way I login to the server. It has nothing to deal with what I'm looking for, I just want the full command to type to get the server to halt everyday at 21:00 – medk Jul 14 '16 at 14:58
  • 1
    But why did you then write "How to do it with SSH?"? – Henrik Jul 14 '16 at 15:00
  • I mean how to do it from the command line while logged as ROOT in SSH (putty) – medk Jul 14 '16 at 15:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.