LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   writing c program to shutdown linux system (https://www.linuxquestions.org/questions/linux-newbie-8/writing-c-program-to-shutdown-linux-system-831722/)

curiousMe 09-12-2010 12:09 PM

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.

Tinkster 09-12-2010 12:21 PM

Hi, welcome to LQ!

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



Cheers,
Tink


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