Control Cron Jobs - Linux

This is a discussion on Control Cron Jobs - Linux ; OS: Linux, Red hat 8.0 Issue: control how long a cron job can run. Hi, Using crontab, I'd like to control the period of time each cron job can run. For example users cron job can only run for 45 ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: Control Cron Jobs

  1. Control Cron Jobs

    OS: Linux, Red hat 8.0
    Issue: control how long a cron job can run.

    Hi,

    Using crontab, I'd like to control the period of time each cron job
    can run. For example users cron job can only run for 45 seconds.
    Only root has access to crontab, root has to set everthing up.

    Thanks,
    Zade.

  2. Re: Control Cron Jobs

    Zade A. wrote:

    > OS: Linux, Red hat 8.0
    > Issue: control how long a cron job can run.
    >
    > Hi,
    >
    > Using crontab, I'd like to control the period of time each cron job
    > can run.


    Using only a deck of cards and a hairpin, I'd like to control how much money
    Bill Gates has in his wallet. However, like using cron to control the
    execution time of a job, my goal is not possible.

    cron only controls /when/ a job is started, not /how long/ it runs for.

    You'll have to find another mechanism to control the length of time a job
    can be run for.

    > For example users cron job can only run for 45 seconds.
    > Only root has access to crontab, root has to set everthing up.




    --

    Lew Pitcher, IT Consultant, Application Architecture
    Enterprise Technology Solutions, TD Bank Financial Group

    (Opinions expressed here are my own, not my employer's)


  3. Re: Control Cron Jobs

    Zade A. wrote on 08/26/2003 05:09 PM:
    > OS: Linux, Red hat 8.0
    > Issue: control how long a cron job can run.
    >
    > Hi,
    >
    > Using crontab, I'd like to control the period of time each cron job
    > can run. For example users cron job can only run for 45 seconds.
    > Only root has access to crontab, root has to set everthing up.
    >
    > Thanks,
    > Zade.


    Instead of launching the user job directly I'd launch a script that in
    turn runs the requested job in the background then check periodically
    whether the job has finished. If the allocated time is reached then just
    kill the job and do whatever reporting you seem appropriate.



  4. Re: Control Cron Jobs

    Eduardo Francos wrote in message news:...
    > Zade A. wrote on 08/26/2003 05:09 PM:
    > > OS: Linux, Red hat 8.0
    > > Issue: control how long a cron job can run.
    > >
    > > Hi,
    > >
    > > Using crontab, I'd like to control the period of time each cron job
    > > can run. For example users cron job can only run for 45 seconds.
    > > Only root has access to crontab, root has to set everthing up.
    > >
    > > Thanks,
    > > Zade.

    >
    > Instead of launching the user job directly I'd launch a script that in
    > turn runs the requested job in the background then check periodically
    > whether the job has finished. If the allocated time is reached then just
    > kill the job and do whatever reporting you seem appropriate.


    Have you looked into the 'at' command? There is a really good article
    about it at 'man at' on your computer

  5. Re: Control Cron Jobs

    Thank you all for the feedback, seems there isn't a fast way of doing
    it only by writing a script. That's doable.

    Thanks,
    Zade.

+ Reply to Thread