LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-20-2010, 03:02 PM   #1
avee137
Member
 
Registered: Apr 2010
Location: bangalore,india
Distribution: ubuntu 9.10,CentOS 5
Posts: 120

Rep: Reputation: 16
Scheduling shutdown after download completion.


Is there any way to schedule shutdown, from terminal,right after some currently running download in mozilla completes??
 
Old 05-20-2010, 03:13 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,933

Rep: Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692
Quote:
Originally Posted by avee137 View Post
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.
 
Old 05-21-2010, 02:27 AM   #3
avee137
Member
 
Registered: Apr 2010
Location: bangalore,india
Distribution: ubuntu 9.10,CentOS 5
Posts: 120

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by TB0ne View Post
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.
 
Old 01-05-2011, 01:19 PM   #4
retrodanny
Member
 
Registered: Jun 2009
Location: México
Distribution: Slackware
Posts: 38

Rep: Reputation: 2
Lightbulb

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!

Last edited by retrodanny; 01-08-2011 at 02:30 AM. Reason: ; and && flipped
 
Old 01-06-2011, 01:48 AM   #5
Andy Alt
Member
 
Registered: Jun 2004
Location: Minnesota, USA
Distribution: Slackware32-stable, Debian32 stable, LFS 7.1
Posts: 385

Rep: Reputation: 44
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.
 
Old 01-06-2011, 03:28 AM   #6
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,130
Blog Entries: 2

Rep: Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825
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.
 
Old 01-10-2011, 02:40 AM   #7
retrodanny
Member
 
Registered: Jun 2009
Location: México
Distribution: Slackware
Posts: 38

Rep: Reputation: 2
Smile

Quote:
Originally Posted by TobiSGD View Post
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bash completion platypuus Programming 8 05-19-2010 12:17 AM
Problem with scheduling shutdown edmondgyampoh SUSE / openSUSE 1 05-18-2009 07:09 PM
IO completion Subsystems rompelstilchen Linux - Networking 0 12-21-2006 06:32 AM
What is the + or - on the completion of a bg job? davee Solaris / OpenSolaris 2 05-05-2005 08:10 AM
Scheduling server and UPS shutdown klmn1 Linux - Software 0 06-19-2003 11:26 PM


All times are GMT -5. The time now is 08:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration