Running offlineimap from cron job – which environment variables are needed?
Profpatsch
mail at profpatsch.de
Fri Feb 8 23:09:35 GMT 2013
On 13-02-02 12:33am, Eygene Ryabinkin wrote:
> 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.
*face—desk*
That’s so me, not looking for a debug option.
It was because I grab the password from a python script which queries
the gnome keyring, which in turn needs an environment variable set.
My whole solution:
l. 36–40:
https://github.com/Profpatsch/dotfiles/blob/master/.xinitrc
l. 14+15:
https://github.com/Profpatsch/dotfiles/blob/master/.backup/crontab
l. 43–46:
https://github.com/Profpatsch/dotfiles/blob/master/.offlineimap/run_offlineimap.sh
~Profpatsch
--
Proudly written in Mutt with Vim on Archlinux.
Q: Why is this email five sentences or less?
A: http://five.sentenc.es
More information about the OfflineIMAP-project
mailing list