Hi I use fcntl.flock() from the fcntl module. I have used this method in C, Perl and Python, works great. Happy to share code.
François > On Dec 18, 2014, at 9:24 AM, Javier Guerra Giraldez <[email protected]> > wrote: > > On Thu, Dec 18, 2014 at 6:20 AM, Erik Cederstrand > <[email protected]> wrote: >> I'm using Django as a hub to synchronize data between various external >> systems. To do this, I have some long-running Django management commands >> that are started as cron jobs. To ensure that only one job is working on a >> data set at any one time, I have implemented a locking system using the >> Django cache system. > > > there are many ways to skin this cat; one of them is doing it the Unix > way with flock. In short, it's a command line tool that makes it easy > to do "if i'm already running, exit now" in shell scripts. > > check the man page, it lists a few ways to do this kind of things. > > http://linux.die.net/man/1/flock > > -- > Javier > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/CAFkDaoTFuxQ-f564uWBd6S%3DPaO960nxRKNLkspqko5DujjhioQ%40mail.gmail.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/C9709909-1AA9-43DB-8E7B-A6676844BC7F%40gmail.com. For more options, visit https://groups.google.com/d/optout.

