LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   schedule program (https://www.linuxquestions.org/questions/programming-9/schedule-program-402346/)

omerlh 01-12-2006 01:24 AM

schedule program
 
Hello!
After I gave up rom finnding a program that run aMule from 00:00 to 7:00, I decide to write, in C, it to myself.
I just want to know how can I get the exact time now(hours and minutes is enaf).
Thanks.

guedellas 01-12-2006 02:00 AM

date +"%H:%M"

But maybe your solution can come with CRON

omerlh 01-12-2006 02:02 AM

It in C?
The cron I have on the computer doesn't have the ability to stop program after a while. It called Kcron.

mic 01-12-2006 02:31 AM

You can set up another cron to kill program, that is to run killall program_name

omerlh 01-12-2006 02:52 AM

That's great idea. Thanks.

bigearsbilly 01-12-2006 04:41 AM

why kill it after a time?

if you must...
here's a script that might work as a cron job
Code:

program_one &              # put in bg
sleep 10                  # adjust to suit
kill $!                    # kill last bg process



All times are GMT -5. The time now is 05:48 AM.