LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-12-2006, 01:24 AM   #1
omerlh
LQ Newbie
 
Registered: Oct 2005
Location: Israel
Distribution: Mandriva
Posts: 14

Rep: Reputation: 0
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.

Last edited by omerlh; 01-12-2006 at 02:03 AM.
 
Old 01-12-2006, 02:00 AM   #2
guedellas
Member
 
Registered: Dec 2005
Location: Espaņa
Distribution: Fedora Core 8 + Debian 4.0 + Vista
Posts: 61

Rep: Reputation: 15
date +"%H:%M"

But maybe your solution can come with CRON
 
Old 01-12-2006, 02:02 AM   #3
omerlh
LQ Newbie
 
Registered: Oct 2005
Location: Israel
Distribution: Mandriva
Posts: 14

Original Poster
Rep: Reputation: 0
It in C?
The cron I have on the computer doesn't have the ability to stop program after a while. It called Kcron.
 
Old 01-12-2006, 02:31 AM   #4
mic
Member
 
Registered: Jun 2005
Posts: 44

Rep: Reputation: 16
You can set up another cron to kill program, that is to run killall program_name
 
Old 01-12-2006, 02:52 AM   #5
omerlh
LQ Newbie
 
Registered: Oct 2005
Location: Israel
Distribution: Mandriva
Posts: 14

Original Poster
Rep: Reputation: 0
That's great idea. Thanks.
 
Old 01-12-2006, 04:41 AM   #6
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,515

Rep: Reputation: 239Reputation: 239Reputation: 239
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

Last edited by bigearsbilly; 01-12-2006 at 04:42 AM.
 
  


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
schedule problem omerlh Linux - Software 1 01-11-2006 02:15 PM
Schedule a task ! L1nuxbug Linux - Networking 4 03-02-2005 07:54 PM
Schedule a graphic program juanczm Linux - General 1 01-28-2005 03:49 PM
Schedule, AGAIN!! erathomor Linux - General 0 04-11-2002 11:25 AM
HOW TO Schedule erathomor Linux - General 3 04-10-2002 01:57 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:03 PM.

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