Nathan Huesken | 1 Jan 19:33 2009

How to know if offlineimap is running

Hi,

I run offlineimap in a cronjob.
Is there a way to know when offlineimap is currently running?
The .offlineimap/lock file seems to always exist ...

Thanks!
Nathan

Loui Chang | 1 Jan 20:44 2009
Picon

Re: How to know if offlineimap is running

On Thu, Jan 01, 2009 at 07:33:18PM +0100, Nathan Huesken wrote:
> I run offlineimap in a cronjob.
> Is there a way to know when offlineimap is currently running?
> The .offlineimap/lock file seems to always exist ...

Maybe you can check if the process described by .offlineimap/pid
is running.

It seems like a bug, that .offlineimap/lock always exists,
but I'm not really familiar with offlineimap's inner workings.

Michael Witten | 8 Jan 16:18 2009
Picon

Re: [PATCH] Fix md5 import error


On 31 Dec 2008, at 10:26 AM, Loui Chang wrote:

>> Paul Hinze <paul.t.hinze <at> gmail.com> on 2008-12-22 at 19:16:
>>> I did a bit of debugging and asking around in #python and it turns  
>>> out
>>> that because Maildir.py uses a conditional import of md5 from either
>>> hashlib or the md5 module, the md5.new() call is not always correct.
>>> The attached patch should fix this problem.
>
> Oh darn. Good thing you caught that.
> Things seem to work fine with hashlib and this patch now.
> I actually tested it this time.

I have pulled from the public git repo:

     git://git.complete.org/offlineimap

and I don't seem to have gotten the new patch; I still
get the runtime error that Paul fixed.

Loui Chang | 8 Jan 16:27 2009
Picon

Re: [PATCH] Fix md5 import error

On Thu, Jan 08, 2009 at 09:18:00AM -0600, Michael Witten wrote:
> 
>  On 31 Dec 2008, at 10:26 AM, Loui Chang wrote:
> 
> >> Paul Hinze <paul.t.hinze <at> gmail.com> on 2008-12-22 at 19:16:
> >>> I did a bit of debugging and asking around in #python and it turns out
> >>> that because Maildir.py uses a conditional import of md5 from either
> >>> hashlib or the md5 module, the md5.new() call is not always correct.
> >>> The attached patch should fix this problem.
> >
> > Oh darn. Good thing you caught that.
> > Things seem to work fine with hashlib and this patch now.
> > I actually tested it this time.
> 
>  I have pulled from the public git repo:
> 
>      git://git.complete.org/offlineimap
> 
>  and I don't seem to have gotten the new patch; I still
>  get the runtime error that Paul fixed.

John Goerzen hasn't pushed it yet. Maybe he's out on vacation hah.

John Goerzen | 8 Jan 17:07 2009

Re: [PATCH] Fix md5 import error

Loui Chang wrote:
> On Thu, Jan 08, 2009 at 09:18:00AM -0600, Michael Witten wrote:
>>  On 31 Dec 2008, at 10:26 AM, Loui Chang wrote:
>>
>>>> Paul Hinze <paul.t.hinze <at> gmail.com> on 2008-12-22 at 19:16:
>>>>> I did a bit of debugging and asking around in #python and it turns out
>>>>> that because Maildir.py uses a conditional import of md5 from either
>>>>> hashlib or the md5 module, the md5.new() call is not always correct.
>>>>> The attached patch should fix this problem.
>>> Oh darn. Good thing you caught that.
>>> Things seem to work fine with hashlib and this patch now.
>>> I actually tested it this time.
>>  I have pulled from the public git repo:
>>
>>      git://git.complete.org/offlineimap
>>
>>  and I don't seem to have gotten the new patch; I still
>>  get the runtime error that Paul fixed.
> 
> John Goerzen hasn't pushed it yet. Maybe he's out on vacation hah.

I was, and now have a serious case of inbox overload.  Will try to get
to this today.

Michael Witten | 9 Jan 08:56 2009
Picon

Gmail: Hard Links

 From a very cursory glance, it seems like hard links
could be used to decrease drastically the footprint
of Gmail folders in the local repository.

What say yee?

Jim Pryor | 9 Jan 12:57 2009
Picon

Re: How to know if offlineimap is running

On Thu, Jan 01, 2009 at 02:44:24PM -0500, Loui Chang wrote:
> On Thu, Jan 01, 2009 at 07:33:18PM +0100, Nathan Huesken wrote:
> > I run offlineimap in a cronjob.
> > Is there a way to know when offlineimap is currently running?
> > The .offlineimap/lock file seems to always exist ...
> 
> Maybe you can check if the process described by .offlineimap/pid
> is running.
> 
> It seems like a bug, that .offlineimap/lock always exists,
> but I'm not really familiar with offlineimap's inner workings.

Yes, specifically you can do this (in a Bash script):

CONFIGDIR="$HOME/.offlineimap"  # this is set in your .offlineimaprc, as
the "metadata" setting. I actually have mine at a different location

BINARY=/usr/bin/offlineimap

if [ -f "$CONFIGDIR/pid" -a $(cat "$CONFIGDIR/pid") = \
    $(pidof -x "$BINARY") ]; then

    # offlineimap is running

else

    # offlineimap not running

fi

(Continue reading)

John Goerzen | 9 Jan 16:49 2009

Re: Gmail: Hard Links

Michael Witten wrote:
>  From a very cursory glance, it seems like hard links
> could be used to decrease drastically the footprint
> of Gmail folders in the local repository.
> 
> What say yee?
> 
> 
> 

Would be great, but how to identify what to link together?

Loui Chang | 9 Jan 18:31 2009
Picon

Re: Gmail: Hard Links

On Fri, Jan 09, 2009 at 09:49:37AM -0600, John Goerzen wrote:
> Michael Witten wrote:
> >  From a very cursory glance, it seems like hard links
> > could be used to decrease drastically the footprint
> > of Gmail folders in the local repository.
> > 
> > What say yee?
> 
> Would be great, but how to identify what to link together?

Changing the way offlineimap indexes messages might help there.

All my duplicate labelled messages have the same checksum, but
offlineimap seems to tack on an md5sum based on something other than the
actual message.

John Goerzen | 9 Jan 22:46 2009

Re: [PATCH] Fix md5 import error

Paul Hinze wrote:
> Paul Hinze <paul.t.hinze <at> gmail.com> on 2008-12-22 at 19:16:
>> I did a bit of debugging and asking around in #python and it turns out
>> that because Maildir.py uses a conditional import of md5 from either
>> hashlib or the md5 module, the md5.new() call is not always correct.
>> The attached patch should fix this problem.
> 
> Thanks to Daniel Rall for pointing out that the attachment got stripped
> off my last message.  Patch follows.

Thank you.  Applied and pushed.

-- John


Gmane