0

When I run mbsync from the command line it works fine. But if mbsync is run from the crontab, mbsync fails with this error "Error: SASL(-1): generic failure:".

My guess is that mbsync's SASL authentication requires an environment variable that cron is not setting, but after much trying I have not been able to spot the problem.

Any ideas?

1

Found an answer to my own question. Cron does not set the environment variable USER. Thus, one solution is to run mbsync from inside a script like this:

#!/bin/sh
USER="YOURUSERNAME"; export USER
mbsync gmail
  • You can do this without a separate script by simply having cron invoke something like env USER="YOURUSERNAME" mbsync gmail (or you can set USER from within your crontab) – a CVn Dec 18 '14 at 15:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.