I'm very new to ubuntu. I am trying to cancel a shutdown I accidently put using the command echo "0 3 * * * root /sbin/shutdown -h 5 'system will reboot in 5 minutes'" | sudo tee /etc/cron.d/reboot-at-3am How can I stop this from shutting down. I wanted it to reboot at 3am but it is just shutting down and not restarting.
Asked
Active
Viewed 628 times
0
Sidewinder
- 1
- 1
-
You will need to edit your `reboot-at-3am` file to say `shutdown -R` if you want to reboot. `-h` means "hard" – Feb 04 '21 at 23:41
-
How do i Edit it? – Sidewinder Feb 04 '21 at 23:54
-
sorry that was supposed to be 0 3 – Sidewinder Feb 04 '21 at 23:55
-
Here's one example of how to edit a text file: https://askubuntu.com/questions/54221/how-to-edit-files-in-a-terminal-with-nano – user535733 Feb 04 '21 at 23:59
1 Answers
0
Just run
shutdown -c
to cancel the pending shutdown and correct your command
kureikain
- 101
- 2
-
Seems like this would only work during the fraction of a second after cron reads the crontab *that minute*. Cron doesn't run commands in advance. – user535733 Feb 04 '21 at 23:44
-
when i try that i get Failed to set wall message, ignoring: Interactive authentication required – Sidewinder Feb 04 '21 at 23:55
-