Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Sep 25th, 2005, 5:35 PM   #1
paulmedic555
Newbie
 
paulmedic555's Avatar
 
Join Date: Jan 2005
Location: Greece
Posts: 18
Rep Power: 0 paulmedic555 is on a distinguished road
Send a message via MSN to paulmedic555
starting programs at a specific time

Hi all silly question but how do i can start a program at a specific time?For example start firefox at 5:00 am?(no crontab)
paulmedic555 is offline   Reply With Quote
Old Sep 25th, 2005, 5:46 PM   #2
stevengs
Professional Programmer
 
stevengs's Avatar
 
Join Date: May 2005
Location: Bad Nauheim, Germany
Posts: 436
Rep Power: 4 stevengs is on a distinguished road
Login on at 4:49, and type the following in a console window: "firefox &"
Then wait for the clock to strike 5.

Why can't you use the crontab, and why do you want to start an interactive program automatically?
__________________
-Steven
"Is this a piece of your brain?" - Basil Fawlty
stevengs is offline   Reply With Quote
Old Sep 26th, 2005, 12:21 AM   #3
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
kinda curious as to why you can't (don't want to) use crontab also... maybe the 'at' command will work.
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Old Sep 26th, 2005, 2:21 AM   #4
paulmedic555
Newbie
 
paulmedic555's Avatar
 
Join Date: Jan 2005
Location: Greece
Posts: 18
Rep Power: 0 paulmedic555 is on a distinguished road
Send a message via MSN to paulmedic555
Well sorry but i supposed that i can't get work cron in bash scripts
paulmedic555 is offline   Reply With Quote
Old Sep 26th, 2005, 6:36 AM   #5
linuxpimp20
Hobbyist Programmer
 
Join Date: May 2005
Location: ma
Posts: 130
Rep Power: 4 linuxpimp20 is on a distinguished road
Quote:
Originally Posted by paulmedic555
Well sorry but i supposed that i can't get work cron in bash scripts
could you clarify? that doesn't make much sense to me. I dunno maybe it's just cuz it's to early.
linuxpimp20 is offline   Reply With Quote
Old May 31st, 2006, 12:52 AM   #6
dakota
Newbie
 
Join Date: May 2006
Posts: 2
Rep Power: 0 dakota is on a distinguished road
Quote:
Originally Posted by paulmedic555
Hi all silly question but how do i can start a program at a specific time?For example start firefox at 5:00 am?(no crontab)
@echo off
:start
for /f "tokens=1,2 delims= " %%a in ('time /t') do set time1=%%a%%b  & ::gets the time into 00:00AA form
if %time1% ==10:34PM goto :ok
goto :start
:ok
:: what to do when time equals 5:00AM
echo what to do when it is 5:00 AM
pause

Tell me how that works and tell me if you need more help
dakota is offline   Reply With Quote
Old May 31st, 2006, 3:44 AM   #7
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
Quote:
Originally Posted by dakota
Tell me how that works and tell me if you need more help
That looks like a batch script, whilst paulmedic555 seems to specify bash.

The "at" command can be used to make a script run at a particular time once. Cron can be used to make a script run repeatly at a particular time.

Do you want firefox to run at 5:00am once, or every day?
Arevos is offline   Reply With Quote
Old May 31st, 2006, 2:02 PM   #8
dakota
Newbie
 
Join Date: May 2006
Posts: 2
Rep Power: 0 dakota is on a distinguished road
I was just trying to help, I thout it was a typo or somthing, I have never herd of bash scripts.
dakota is offline   Reply With Quote
Old May 31st, 2006, 2:05 PM   #9
uman
Expert Programmer
 
Join Date: Dec 2004
Posts: 794
Rep Power: 4 uman is on a distinguished road
bash is the most commonly used Linux shell.
__________________
Few people deserve to be compared to (Rush) Limbaugh, most of them were convicted at the Nuremburg trials.
--WilliamSChips on Slashdot
uman is offline   Reply With Quote
Old May 31st, 2006, 2:48 PM   #10
Cerulean
Professional Programmer
 
Cerulean's Avatar
 
Join Date: Apr 2005
Location: London, England
Posts: 459
Rep Power: 4 Cerulean is on a distinguished road
Make sure you have atd running (the at daemon), then it's as simple as:
at 05.00
at> firefox
at> (ctrl+d)
Cerulean is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:51 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC