How To Automatically Shut Down Your Computer After A Download Finishes

Want to support HowtoForge? Become a subscriber!
Submitted by PlayHazel (Contact Author) (Forums) on Tue, 2011-04-26 10:01. :: Ubuntu | Desktop | Monitoring

How To Automatically Shut Down Your Computer After A Download Finishes

Sometimes you want to download something but don't want to wait until it finishes so you can shut down the computer. In this case you can use Sentinella. Install it with the following command:

sudo apt-get install sentinella

Now you can see Sentinella under the System menu of your desktop. Launch it and you will see something like this:

Sentinella screenshot

Use the same settings as in the screenshot but make sure you choose your main network interface. Just press the Start button and that's it!

Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.
Submitted by Roberto (not registered) on Fri, 2011-07-29 21:58.

If you are downloading over firefox, jus install the addon AutoShutdown.

 It places a button to enable checking status of downloads and shutdown the computer when all are completed.

Submitted by Anonymous (not registered) on Tue, 2011-04-26 15:38.

The following advice assumes you already have 'wget' installed:
1. Open a terminal
2. $ wget ; sudo halt

Submitted by Bryce (not registered) on Tue, 2011-05-10 18:34.
I'm more of a fan of $ wget && sudo halt. In the command above you assume that then download will complete without issue. If it doesn't; you wouldn't know.
Submitted by plamen (not registered) on Wed, 2011-04-27 23:48.

Yes, you are right. But usually one runs wget and later he  decided to stop computer when download is finished.

Simple solution is cron job running every n minutes (where n can be usually 2, 5 or 10 minutes) checking if wget is still running ( ps | grep wget ) and halt computer when no output is emitted.


Submitted by Anonymous (not registered) on Fri, 2011-04-29 06:58.

while true; do pgrep <downloading process> || shutdown -h now; sleep 10 ; done

Submitted by Anonymous (not registered) on Fri, 2011-04-29 05:46.


fg; sudo halt

Or if you need to use the "ps | grep" method, check out pgrep and watch out for "ps | grep" matching itself.


Submitted by Anonymous (not registered) on Mon, 2011-07-18 11:51.
nice & elegant solution!