Find the answer to your Linux question:
Results 1 to 7 of 7
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    how to execute an application/program after a certain amount of time has passed

    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...

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

  2. #2
    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.

  3. #3

    thanks :D


    i just looked at the man file for crontab...i think that is probably what i am looking for...I am new to i might need a couple of days to tell you if i get it working for me...thanks so much for the help...

  4. $spacer_open
  5. #4
    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 are as follows


    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...?

  6. #5
    Try specifying the full path instead of './'.


  7. #6
    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.

  8. #7
    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...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts