LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Scheduling shutdown after download completion. (https://www.linuxquestions.org/questions/linux-newbie-8/scheduling-shutdown-after-download-completion-809132/)

avee137 05-20-2010 02:02 PM

Scheduling shutdown after download completion.
 
Is there any way to schedule shutdown, from terminal,right after some currently running download in mozilla completes??

TB0ne 05-20-2010 02:13 PM

Quote:

Originally Posted by avee137 (Post 3975754)
Is there any way to schedule shutdown, from terminal,right after some currently running download in mozilla completes??

Not that I'm aware of. However, you COULD always use wget for the download in a script, and have a shutdown after it. Like
Code:

wget <url of file to get>
shutdown -h 0

If you run that as root, you're all set.

avee137 05-21-2010 01:27 AM

Quote:

Originally Posted by TB0ne (Post 3975762)
Not that I'm aware of. However, you COULD always use wget for the download in a script, and have a shutdown after it. Like
Code:

wget <url of file to get>
shutdown -h 0

If you run that as root, you're all set.

Thanks,i ll try that next time.This time,I scheduled it a couple of minutes ahead the expected time to complete the download.

retrodanny 01-05-2011 12:19 PM

That's one way to do it, another is to use ';' or '&&' to run both commands, one after the other. Like this:
(first become root!)
Code:

wget <URL>; shutdown -h 0
or:
Code:

wget <URL> && shutdown -h 0
Difference is that when using ';', if the first command (wget) fails, the computer will still shutdown. This won't happen with '&&'

no need for a script!

Andy Alt 01-06-2011 12:48 AM

If you have a rough idea of when the download will complete, you can use the sleep command:

sleep 60m ; shutdown -h now

or sleep 2h ; shutdown -h now

It won't be as exact as the method above, but it's an option. :)

Also you can schedule shutdown times with the shutdown command itself. See man shutdown.

TobiSGD 01-06-2011 02:28 AM

Wouldn't it be the simplest solution to use a download-manager that allows it, like JDownloader?
Estimation of the remaining download-time can be a major failure, because in most cases you don't the load of the server at any time.

retrodanny 01-10-2011 01:40 AM

Quote:

Originally Posted by TobiSGD (Post 4214907)
Wouldn't it be the simplest solution to use a download-manager that allows it, like JDownloader?
Estimation of the remaining download-time can be a major failure, because in most cases you don't the load of the server at any time.

maybe, may be not... usually doing things in the terminal is the cleanest way to accomplish something. Plus, its just a one-line command


All times are GMT -5. The time now is 07:50 PM.