Cronjob every 30secs

Marc Wiatrowski mwia at iglass.net
Tue May 12 20:38:23 UTC 2009


If you wanna use cron, why not something like:

* * * * *  python_script; sleep 30; python_script


On Tue, 2009-05-12 at 15:23 -0400, Tence T. George wrote:

> Okay, I guess I can go with the endless shell script and I wouldn't
> need the cron for it either.  I might make it into startup script
> launched as a particular user.  Thanks guys
> 
> 
> 
> 
> On Tue, May 12, 2009 at 2:50 PM, Rashkae <ubuntu at tigershaunt.com>
> wrote:
> 
>         
>         Tence T. George wrote:
>         > Hey guys,
>         >
>         > I wrote a python script using pysvn that checks my svn
>         server and
>         > updates/exports directorys on my ubuntu webserver. But, now
>         I need it to run
>         > every 30secs so that developers working on the same project
>         don't need to
>         > wait so long to see changes done to the developmental side
>         of the website.
>         > I don't really care for how many cpu cycles it uses up since
>         the machine is
>         > multicore comp.  I did some googling and most sites say that
>         crons can't do
>         > less than a minute.  I was just wondering if anyone had a
>         workaround for it.
>         >
>         > From,
>         > Tence T. George
>         >
>         >
>         
>         
>         
>         Use a shell script with an infinite loop and a 30 second sleep
>         (or 25
>         second sleep, assuming the process takes 5 seconds to
>         complete.)
>         
>         
>         #!/bin/bash
>         while [ 1 ]
>         do
>                # Your code goes here
>         
>                # Modify sleep time (in seconds) as needed below
>                sleep 2
>         done
>         
>         
>         
>         --
>         ubuntu-users mailing list
>         ubuntu-users at lists.ubuntu.com
>         Modify settings or unsubscribe at:
>         https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>         
> 
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20090512/1e1fe4b0/attachment.html>


More information about the ubuntu-users mailing list