-1

I want to reboot at every minute but my code doesn't work.

crontab file screenshot

  • 6
    Please don't add code as pictures especially if it's a oneliner this only proves lazyness – derHugo Aug 1 '17 at 15:45
5
  1. Your line is commented out so never performed
    -> delete the # at the start

  2. It should be * * * * * for every minute

  3. (Thanks to @Rinzwind) reboot does not work It has to be
    systemctl reboot -i

So in the end in your file there should be the line

* * * * * systemctl reboot -i

-i here stands for ignore-inhibitors. Some programs put this inhibitors lock to prevent dataloss so you wouldn't reboot but get a note in the command line.

This should do the trick

Note: Not letting unmentioned here that this doesn't seem a smart idea to me ... Why do you want that? And make sure you are able to revert this before your system reboots again when you don't want this anymore ;)

  • Well it has a lot to do with the question.. but I see and accept what you mean. – derHugo Aug 1 '17 at 15:44
  • This is correct, but the answer is incomplete. Usually reboot command needs 'sudo' rights, so this must be written in root's crontab - sudo crontab -e, or in /etc/crontab or somewhere in /etc/cron.d/. It is also recommended to use the fill path to the program within crontab, so we can write which reboot to find it... – pa4080 Aug 1 '17 at 15:51
  • I'm pretty sure the image already shows the file edited by sudo crontab -e .. the question is incomplete in information though. Usually those are already performed with root permissions – derHugo Aug 1 '17 at 15:53
  • 1
    @pa4080 nope. reboot does not But the command is wrong. systemctl reboot -i is the command to use. – Rinzwind Aug 1 '17 at 17:51
  • @Rinzwind thanks didn't know that. Actually for certain reason never tried this before until I came home now but you are right. Edited my answer – derHugo Aug 1 '17 at 20:38

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.