chaoseternal at gmail.com
Mon Mar 12 03:05:52 CET 2007
Obviously , you didn't aware when your script didn't finish in one
minute the cron would start another script doing the same job. As you
have mentioned, 1 minute was not enough to sync tree. I think that is
the core problem.
So my suggestion is , when your script starts, aquire a lock, then do
all the sync things, and release the lock before exit.
Hope my suggestion can help.
On 3/12/07, Ervin Hegedüs <airween at gmail.com> wrote:
> > chaos at felucia:~$ ps afx|grep sleep
> > 25170 ? Ss 0:00 | \_ sleep 300
> > 25246 ? Ss 0:00 | \_ sleep 300
> > 25324 ? Ss 0:00 | \_ sleep 300
> > 25403 ? Ss 0:00 | \_ sleep 300
> > 25486 ? Ss 0:00 \_ sleep 300
> > 25530 pts/5 S+ 0:00 | \_ grep sleep
> > chaos at felucia:~$ crontab -l
> > # m h dom mon dow command
> > * * * * * sleep 300
> > have i missed something?
> Nothing. Or rather yes. :)
> I didn't wrote, the run-time of script usually less than 1sec.
> Here is my output:
> # ps axf | grep chkdir.py
> 24859 pts/2 S+ 0:00 \_ grep chkdir.py
> > > Hmmm... I think there is _no_ other thread (or process), what wants to
> > > write to database.
> > Still dont get it?
> no, I don't.
> > If the event only occures 1-5 time per-week, why you make your script
> > run every minute?
> Because event occurs randomly: sometime it occur monday morning,
> sometime friday evening - sometime it occurs in workhours, sometime
> out of workhours.
> This is not so simple....
> Thank you:
More information about the python-ldap