How To Use Auto Shutdown At Linode Instance ?

So I Want My Linode Instance But I Don't Know How To Schedule Shutdown At My Linode Can someone help me ?

1 Reply

To schedule a shutdown for a Linode, you have two options: using the at command or the cron utility.

Using the at command

Here's an example of how to use the at command to schedule a shutdown:

echo "shutdown -h now" | at HH:MM

Replace HH:MM with the desired time in a 24-hour format. For instance, to schedule a shutdown at 10:30 PM, use 22:30.

Please note that the at command may not be installed by default. If that's the case, you can install it by running the following command:

sudo apt update && sudo apt install at

Using the cron utility

To schedule a shutdown using the cron utility, follow these steps:

  1. Access your Linux VPS and run the following command:
sudo crontab -e
  1. If prompted, choose an editor (e.g., nano, vim) to edit the file.

  2. In the editor, add the following line to schedule a shutdown at a specific time:

MM HH * * * shutdown -h now

Replace MM with the desired minute and HH with the desired hour, both in a 24-hour format. For example, to schedule a shutdown at 10:30 PM, you would use 30 22 * * *.

  1. Save the file and exit the editor.

The shutdown command will be scheduled to execute at the specified time based on the cron job.

Remember to adjust the commands based on your specific Linux distribution and user privileges. It's also a good idea to inform any other system users that might be affected by the shutdown to avoid any unexpected issues or loss of work.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct