Re: Run script as often as possible

From: Adam Funk (a24061_at_yahoo.com)
Date: 09/28/04

  • Next message: Justin Guerin: "Re: keeping woody"
    Date: Tue, 28 Sep 2004 16:49:49 GMT
    To: debian-user@lists.debian.org
    
    

    On Tuesday 28 September 2004 16:30, Dave Carrigan wrote:

    > On Tue, Sep 28, 2004 at 11:23:15AM +0200, Jacob Larsen wrote:
    >> I have a script that I'd like to run as often as possible.
    >> The script may only run in 1 instance.
    >> My idea is to have a cron script to start it once every hour. The
    >> script should write a run file, and if the run file exists, exit.
    >> Is this the best way?
    >
    > Run it from init by putting an entry into your inittab. As soon as it
    > exits, init will respawn it. The upside is that there is no need to do
    > locking or process synchronization. The following inittab entry would
    > work.
    >
    > mysc:2345:respawn:/path/to/myscript

    That runs the script as root, right? If you wanted to run it with as
    another user, would you just stick a bit of sudo in that inittab entry?

    -- 
    To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org 
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
    

  • Next message: Justin Guerin: "Re: keeping woody"

    Relevant Pages

    • Re: Oracle on RHEL4 with ASM problem
      ... When ASM throws this error I have to comment out this entry in inittab, run 'init q', uncomment the inittab entry and run 'init q' again. ... you may able to hack that script to put e.g. "sleep 5" at the top -- this is a dirty hack; hopefully running the script by hand should give you some more information. ... If the sleep trick fixes it, then I'd suggest that that script is restarting too quickly for initto assume that it's successful - you should see messages in /var/log/messages that say something like ...
      (RedHat)
    • Re: Run script as often as possible
      ... > I have a script that I'd like to run as often as possible. ... Run it from init by putting an entry into your inittab. ... The following inittab entry would ... Dave Carrigan ...
      (Debian-User)
    • Re: run a script after every reboot
      ... > I want to run a script after every reboot, what files i need to create or ... There are various ways of doing it: put an entry to call the script in ... /etc/rc.nfs or /etc/rc.local or create an inittab entry. ...
      (comp.unix.aix)
    • Re: Changing a users password non-interactively?
      ... You need expect and a setpass.expect script which ill add ... exit with a nasty warning. ... # Be careful of the COMMAND and UNDOCMD - they are dependant on your ...
      (comp.unix.aix)
    • Re: script does not always work the same each time.
      ... I have written a simple script to test code build and test run on a ... $lineterminationChar {append output $expect_out; ... exit 1;} ...
      (comp.lang.tcl)