Forum     

Go Back   Digit Technology Discussion Forum > Software > Open Source
Register FAQ Calendar Mark Forums Read

Open Source A place where you can talk to like-minded people about the fastest growing software movement today! Discuss anything and everything about Open Source software and Operating Systems.


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 27-06-2006, 05:30 PM   #1 (permalink)
In The Zone
 
Join Date: Jul 2005
Posts: 363
Question Autoshutdown in Linux.. ??


In windows we have a option which auto shutdowns or Hibernate yr computer if it is idle for a certain time which you can deceide....
Ubuntu allows to Hibernate but is there any option which allows me to set tht if my comp is idle for more than 1/2 an hour it should automatically hibernate...
dabster is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 27-06-2006, 08:04 PM   #2 (permalink)
Wise Old Owl
 
JGuru's Avatar
 
Join Date: Dec 2005
Location: Space-time continuum
Posts: 1,646
Default Re: Autoshutdown in Linux.. ??

Yes, there is an option available in all Linux distros. Type 'xscreensaver-demo' in the
Terminal or you can open 'screensaver' in the '/usr/share/applications' folder.
Click on the 'Advanced' tab.There on the top-right there is a header called 'Display Power Management' Click on the checkbox 'Power Management Enabled'. There are Options like 'Standby After : 30 min', 'Suspend After: 45 min', 'Off After : 60 min'. For auto-shutdown , by default the System shuts down automatically
after being idle for 60 min (1 hour). You can customize it as per your needs.
That's all.
JGuru is offline  
Old 28-06-2006, 12:16 AM   #3 (permalink)
String Phreak
 
mediator's Avatar
 
Join Date: Mar 2005
Location: In ur Evil Mind!
Posts: 2,457
Default Re: Autoshutdown in Linux.. ??

Well I dont use the screensaver method! I have developed a script that performs autoshutdown......I developed coz i have to shutdown limewire and all downloads and the system at 8:00 am......coz i have mtnl 590 broadband!! Neways u may use my script

*************** save as "autoshutdown.sh"****************
echo -n "Enter shutdown timing (like 06-00) : ";read tim
echo "Shutdown scheduled for $tim"
while [ 1 ]
do
if [ "`date "+%H-%M"`" = "$tim" ];then
echo "`date -R`" > log.log
/sbin/shutdown -h now
echo "SHutdown Initiated"
exit
else
echo -n ""
fi
done
*************** Run as root as "sh autoshutdown.sh" ***********

Have fun......Enter the timing as 15:00 for 3pm and 07:00 for 7 am etc !!
U may see log.log file where u saved autoshutdown.sh for shutdown history!

Last edited by mediator; 28-06-2006 at 12:18 AM.
mediator is offline  
Old 28-06-2006, 12:21 AM   #4 (permalink)
FooBar Guy
 
GNUrag's Avatar
 
Join Date: Jun 2004
Location: GNUmbai
Posts: 1,245
Default Re: Autoshutdown in Linux.. ??

mediator, that was cool!
there is another way many people use, they rather send commands to the adsl router and shutdown that instead. i'll locate the script and post it.
__________________
- --
http://web.gnuer.org
GNUrag is offline  
Old 18-11-2006, 07:56 AM   #5 (permalink)
In The Zone
 
ApoorvKhatreja's Avatar
 
Join Date: Aug 2006
Location: Delhi
Posts: 229
Default Re: Autoshutdown in Linux.. ??

I'm using Ubuntu 6.10 (Edgy Eft) and I have an MTNL 590 NU plan which requires a reboot at 12:00 A.M. and 8:00 A.M. In Windows, I have automated this process by shifting my modem to bridged mode, and then i can connect/disconnect by merely scheduling the dialling of a connection. But in Ubuntu, I am not even able to get my connection running. Could somebody help me?

I configured my modem by this link -
http://broadbandforum.in/Utstarcom-B...oot-t4794.html
ApoorvKhatreja is offline  
Old 18-11-2006, 12:31 PM   #6 (permalink)
In The Zone
 
Join Date: Oct 2006
Location: Mumbai
Posts: 365
Default Re: Autoshutdown in Linux.. ??

@mediator i think using of poweroff command would be better than shutdown -h.
as it will close the program forcefully
Code:
echo  "time now is - `date "+%H:%M:%I"`" 
echo -n "Enter shutdown timing (like 06-00) : ";
read tim

echo "Shutdown scheduled for $tim"
while [ 1 ]
do
if [ "`date "+%H-%M"`" = "$tim" ];then

echo "`date -R`" > log.log
poweroff
echo "SHutdown Initiated..."
exit
else
echo -n ""
fi
done
can u pls add the code to display current time in while loop and time remaining to shutdown pc?
__________________
Dhiraj Thakur
thakur.dheeraj(@)gmail.com

Last edited by Desi-Tek.com; 18-11-2006 at 12:37 PM. Reason: .
Desi-Tek.com is offline  
Old 18-11-2006, 05:00 PM   #7 (permalink)
String Phreak
 
mediator's Avatar
 
Join Date: Mar 2005
Location: In ur Evil Mind!
Posts: 2,457
Default Re: Autoshutdown in Linux.. ??

^^shutdown -h also kills all the programs forcefully!
The code u asked for is easy to add, but I dont know how to play with cursors. If I add the code, it will be repeatedly shown on the screen and may make the terminal cache unstable resulting in the failure of the program.
__________________
Bad Bad server.....No candy for u!
mediator is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


 
Latest Threads
- by topgear

Advertisement




All times are GMT +5.5. The time now is 08:48 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2