0

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.

4
  • You will need to edit your reboot-at-3am file to say shutdown -R if you want to reboot. -h means "hard" 🤐
    – user1091774
    Feb 4, 2021 at 23:41
  • How do i Edit it?
    – Sidewinder
    Feb 4, 2021 at 23:54
  • sorry that was supposed to be 0 3
    – Sidewinder
    Feb 4, 2021 at 23:55
  • Here's one example of how to edit a text file: askubuntu.com/questions/54221/…
    – user535733
    Feb 4, 2021 at 23:59

1 Answer 1

0

Just run

shutdown -c

to cancel the pending shutdown and correct your command

3
  • 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 4, 2021 at 23:44
  • when i try that i get Failed to set wall message, ignoring: Interactive authentication required
    – Sidewinder
    Feb 4, 2021 at 23:55
  • @Sidewinder did you run it with sudo or as root?
    – kureikain
    Feb 5, 2021 at 16:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .