Running offlineimap from cron job – which environment variables are needed?

Eygene Ryabinkin rea at codelabs.ru
Fri Feb 1 20:33:58 GMT 2013


Fri, Feb 01, 2013 at 03:09:56PM +0100, Profpatsch wrote:
> I’m still trying to run offlineimap from cron (better: fcron), but
> since cron doesn’t set any environment variables except for HOME and
> SHELL.
> I get error messages without any clues what error occured, and it has
> to be because of unset environment varibles because running it from
> shell with the same options works just fine.
> 
> Try %env -i offlineimap -u ttyui for yourself and see if it works (env
> -i unsets the env varibles for that command).

For me, 'env -i HOME="$HOME" offlineimap -u ttyui' works fine.  Probably
in your case 'env -i offlineimap -d ALL -u ttyui' will provide some more
insight.  Please, post the output of that variant.

> It produces the same errors as the cronjob.
> 
> Errorlog:
> 
> OfflineIMAP 6.5.4
>   Licensed under the GNU GPL v2+ (v2 or any later version)
> Account sync Stuff:
>  *** Processing account Stuff
>  Establishing connection to sslmailpool.ispgateway.de:993
> Account sync Privat:
>  *** Processing account Privat
>  Establishing connection to sslmailpool.ispgateway.de:993
> Account sync Mail:
>  *** Processing account Mail
>  Establishing connection to sslmailpool.ispgateway.de:993
> Account sync Stuff:
>  ERROR: While attempting to sync account 'Stuff'
> 

The last line is really empty?  If it is, run with '-d ALL' is really
recommended ;))
-- 
rea




More information about the OfflineIMAP-project mailing list