LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 09-12-2010, 01:09 PM   #1
curiousMe
LQ Newbie
 
Registered: Sep 2010
Posts: 1

Rep: Reputation: 0
Unhappy writing c program to shutdown linux system


I usually download files from internet throughout the night. I can shut down computer automatically using command

shutdown -P time
.
This works well ,
but very often ,electric supplies cutoffs and system get rebooted and remain booted uselessly.
In such case i want to use c program to shut down system after particular time which i will add on startup application list.
If i added it on startup application every time i boot the computer it will automatically shutdown after particular time so ,to use the system i should be able to disable that program.
 
Old 09-12-2010, 01:21 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Hi, welcome to LQ!

You should be able to use 'at' and a wee shell script for this.



Cheers,
Tink
 
  


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
linux machine shutdown from a C program vijay_babu1981 Programming 14 07-09-2009 12:21 PM
writing a c program in linux which plays an'.wav' file stephenwalter Programming 8 07-09-2005 12:37 AM
Writing a CPU Consume Program to Test a Distributed System russelh Programming 4 11-30-2004 03:27 PM
How does one shutdown and reboot linux from within a program? prometheus7817 Linux - General 2 08-27-2003 07:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05: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