Tag Archives: shutdown

XBMCbuntu: How to Automatically Shutdown your PC Tips, Tricks and Tutorials 03 JUL 2014

Because XBMCbuntu is essentially a light-weight Ubuntu install configured to run XBMC at startup, you have access to most of the basic commands that a normal Ubuntu box would have. In other words, you have access to all the normal niceties of Ubuntu – like the crontab, the perfect way of scheduling an automatic shutdown of your XBMC media server. You know, because a) you like the idea of saving electricity, or b) your old hardware powering your media server is a little… well noisy.

Anyway, bring up a terminal by pressing ALT+CTRL+F1. Your login details will be those that you setup during install. If you don’t have those on hand, then you could try the default XMBC root user which has the details of username=’xbmc’ and password=” (blank).

Now to edit the crontab (as sudo of course) to set up our scheduled task:

sudo crontab -e

Add the shutdown rule as follows. In this case, it is set to run the shutdown command every evening at 1 o’clock in the morning – everyone should be asleep by then, movie nights done and dusted for sure! (Obviously you can set whatever times you want, play around a little if you must.)

0 1 * * * /sbin/shutdown -P now

Save the crontab and on exit of the editor, you should see the line saying “Installing new crontab”. You can obviously test the command yourself right then and there by running:

sudo /sbin/shutdown -P now

Although this will of course shutdown your machine. If you just want to jump back to XBMC, hit ALT+CTRL+F7.

A useful tip if your small child isn’t quite capable of controlling XBMC just yet! :)

xbmc-logo-banner

Related Link: http://wiki.xbmc.org/?title=XBMCbuntu

Ubuntu Cron: How to Schedule Your PC to Automatically Shutdown Every Evening CodeUnit 10 AUG 2011

Electricity is expensive at the moment and as such every little bit that you save helps control this cost just that little bit more. However, I am guilty of often just leaving devices on for no apparent reason, and so this next little trick goes a long way in making sure I can’t get away with leaving my study a blur of various color LED lights all night long.

As with Window’s scheduled task functionality, Ubuntu comes with its Crontab, a service that is able to run scheduled cron jobs that you can assign per user. We’ll leverage this ability to make sure that our PC powers down just after midnight, just in case we forgot to hit the power button before turning in for the night.

Because the native shutdown command required elevated sudo rights, open the your crontab with the following command via the terminal:

sudo crontab -e

Note that if you don’t have a crontab set up yet, it will prompt you to select an editor. And yes, they are right. Nano is the simplest editor to use in this instance.

On a new line, enter:

01 00 * * * /sbin/shutdown -P now

Save and exit. The machine will automatically install the updated cron.

What the above command does is say that at 1 minute past midnight, execute the shutdown command (which is stored in /sbin) using the -P flag to indicate power down and now to say this must happen straight away.

Nifty.

Ubuntu: How to Reboot or Shutdown from the Command Line CodeUnit 10 JAN 2010

If you’re using Ubuntu or perhaps another flavour of Linux, there come a time when you need to either reboot (restart) or shutdown a machine via a terminal (command line) or shell command.

Of course, it does come as no surprise that in order to carry out either of these two commands, you will need administrator privileges on the machine that you are currently using, in other words, sudo is once more you best friend.

To shut down / power off your Ubuntu PC, type in the command:

sudo halt

or

sudo shutdown -h now

Alternatively, to restart / reboot your machine, enter the command:

sudo reboot

As always, more information on both of these commands can be found via the man system:

man reboot

man shutdown

Investigate when a Windows Server Lost Power CodeUnit 09 JAN 2010

Our server room went down the other day and I was called upon to investigate at what time more or less did the room actually lose power.

Now the easiest way to figure this one out is to investigate on the Windows 2003 Server machine, making use more specifically of the Windows built in Event Viewer tool.

Now Windows uses a number of unique event codes to identify system shutdown and startup events, the most useful of these being:

...