0

On linux, you can do a shutdown -r 17:00 to reboot at 5pm. Every so often there will be a message that appears system wide that says System will go down in X minutes.

Is there a way to force this message to appear or verify that a shutdown -r 17:00 & is running in the background without cancelling the current shutdown?

1 Answer 1

1

You can verify jobs that are running in the background by using the command:

jobs

Like this:

root@server1:/var/www/nodebb# jobs [1]+ Running shutdown -r 17:00 &

Here is a good resource on learning how to use jobs, and manage background jobs in general: http://www.cyberciti.biz/faq/linux-command-line-run-in-background/

Keep in mind that the job is tied to your session, if you close it ( AKA close the shell ) your job wont run. A better option for me would be to use cron to schedule the reboot.

Edit your crontab:

crontab -e

Now enter the cron entry... this will reboot the box every day at 5pm. (17:00)

*   17  *   *   *   shutdown

Thats it for cron! You can view your crontab via:

crontab -l
5
  • This command doesn't appear to be in Debian. Does it have synonyms?
    – AWippler
    Commented May 29, 2014 at 17:49
  • 1
    @AWippler - What shell are you using? I believe this is part of the bash shell: echo $SHELL to see which shell you use.
    – Tillman32
    Commented May 29, 2014 at 18:01
  • /bin/bash is what I am using on this rpi. ps aux | grep shutdown is similar to jobs; however, this doesn't push out the global shut down message.
    – AWippler
    Commented May 29, 2014 at 19:03
  • Well the ps command just shows processes, so it's not an alternative. Try this: ps aux | grep shutdown | grep -v grep and I bet that comes back with nothing. Essentially when you grep, that is also a process, so you're probably just getting your grep process returned and not the shutdown process. The -v grep says omit the grep process.
    – Tillman32
    Commented May 29, 2014 at 20:59
  • Do an apt-cache search jobs and see what packages come back, maybe there is something that you can install that is the jobs command itself or similar. Or just use Cron.
    – Tillman32
    Commented May 29, 2014 at 21:00

You must log in to answer this question.

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