Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Write an article for LinuxForums Today! Win Great Prizes!
Find the answer to your Linux question:
New to Linux Forums? Register here for free!
    Linux Forums > GNU Linux Zone > Misc > how to execute an application/program after a certain amount of time has passed

Forgot Password?
 Misc   Any questions or Linux discussion that does not fit in any of the other technical areas.

Site Navigation
Linux Articles
Linux Forums
Linux Downloads
Linux Hosting
Free Magazines
Job Board
IRC Chat
RSS Feeds
Linux Forum Topics
Linux Forums
Your Distro
Linux Resources
GNU Linux Zone
The Community
Reply
 
Thread Tools Display Modes
Old 08-14-2007   #1 (permalink)
Just Joined!
 
Join Date: Aug 2007
Posts: 15
how to execute an application/program after a certain amount of time has passed

hi
I have the following problem...

I have a program (c++ code) which updates some logs...
I was wondering that is there a way by which i can execute this code/program after every two (or what ever time period expires )by creatiing some sort of script which runs automatically after every two hours and updates the logs by using the program ...

I mean to say that once i run the script the program will be executed after every two hours...

thanks
p.s. if this forum is not for these sort of question i am deeply sorry...
bilalb is offline  



Reply With Quote
Old 08-14-2007   #2 (permalink)
scm
Linux Engineer
 
Join Date: Feb 2005
Posts: 1,004
Sounds like a job for cron or at. "man at", "man cron", "man 1 crontab" and "man 5 crontab" for details, then come back and tell us if it's not what you want, or if it is and you need more help.
scm is offline   Reply With Quote
Old 08-14-2007   #3 (permalink)
Just Joined!
 
Join Date: Aug 2007
Posts: 15
thanks :D

Hi

i just looked at the man file for crontab...i think that is probably what i am looking for...I am new to Linux...so i might need a couple of days to tell you if i get it working for me...thanks so much for the help...
bilalb is offline   Reply With Quote
Old 08-19-2007   #4 (permalink)
Just Joined!
 
Join Date: Aug 2007
Posts: 15
hi
i tried using cron.hourly folder in /etc to run the program by using a shell file..

the shell file only contains the path of the program(named testme which i copied in the cron.hourly folder) which i want to run i.e.
the contents of the shell file (which i named test.sh) are as follows

./testme


but the program testme is not running ...i used chmod for both files...i did check that the cron was running... i am logged in as root user ... am i missing something...?
thanks...
bilalb is offline   Reply With Quote
Old 08-20-2007   #5 (permalink)
Linux User
 
Join Date: Jun 2007
Posts: 318
Try specifying the full path instead of './'.

Vic
vsemaska is offline   Reply With Quote
Old 08-21-2007   #6 (permalink)
Just Joined!
 
antivirus_b's Avatar
 
Join Date: Mar 2007
Posts: 28
I think you should read this document first.

Newbie: Intro to cron
cron,cron job,cron tutorial,cron unix,unix cron job.


Maybe this document will help you to solve your probem.
antivirus_b is offline   Reply With Quote
Old 08-26-2007   #7 (permalink)
Just Joined!
 
Join Date: Aug 2007
Posts: 15
thanks
a lot guys it did help... i did what ever there was in the tutorial...but i still can't get it working...i think i am missing something in the script... i guess i have to look for some shell scripting tutorial now...thanks a lot for helping everyone...
bilalb is offline   Reply With Quote
Reply


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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Free Magazines
A Newbie's Getting Started Guide to Linux
Learn the basics of the Linux operating systems. Get to know what it is all about, and familiarize yourself with the practical side. Basically, if you're a complete Linux newbie and looking for a quick and easy guide to get you started this is it.
subscribe
Run Your Own Web Server Using Linux & Apache - Free 191 Page Preview
Learn about everything you'll need to build and maintain your Linux servers, and to deploy Web applications to them.
subscribe
Open Source Security Myths Dispelled
Dispel the five major myths surrounding Open Source Security and gain the tools necessary to make a truly informed decision for your IT organization
subscribe
InformationWeek
InformationWeek is the only newsweekly you'll need to stay on top of the latest developments in information technology.
subscribe



All times are GMT. The time now is 11:59 PM.






© 2000 - - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.3.1