Project

General

Profile

Mailchecker not running in crontab

Added by Jeffrey Lee about 6 years ago

I am attempting to run the redmine:email:receive_imap task via crontab as the redmine user. The difficulty I'm having (I think) is that rvm isn't active for the redmine user. So, I wrote a script as follows:

source /etc/profile
rvm use 2.4.1
cd /usr/local/share/redmine/bin
./rake -f /usr/local/share/redmine/Rakefile redmine:email:receive_imap RAILS_ENV="production" host=outlook.office365.com username= password=<password> port=993 ssl=true project=support

If I run the script as the user (sudo su redmine, followed by executing the script) everything works as I expect. However when I execute the script from crontab:

*/1 * * * * redmine /etc/mailCheck.sh

The syslog reports that the job ran, but no issue is created (and the email is still unread in the inbox).


Replies (2)

RE: Mailchecker not running in crontab - Added by Bernhard Rohloff about 6 years ago

I would suggest you to log your cronjob to a text file for further investigations.

*/1 * * * * redmine /etc/mailCheck.sh >> wtf.log

RE: Mailchecker not running in crontab - Added by Jeffrey Lee about 6 years ago

Gave that a try, but oddly while the log file is created it is empty. I would, at the very least, expect some output from the RVM command.

    (1-2/2)