LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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, 12: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, 12:21 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

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

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



Cheers,
Tink
 
  


Reply



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

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

All times are GMT -5. The time now is 09:51 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
Open Source Consulting | Domain Registration