Project

General

Profile

Cron not reading mail

Added by Роман Лебедев almost 10 years ago

Can not get mail through cron, but the console is working

System info
OS FreeBSD
Environment:
Redmine version 2.6.0.stable.13591
Ruby version 2.0.0-p576 (2014-09-19) [i386-freebsd10]
Rails version 3.2.20
Environment production
Database adapter Mysql2

Cron
*/30 * * * * root /bin/readmail.sh>/tmp/redmine-email.log 2>&1

readmail.sh
#!/bin/sh
rake -f /disk2/www/redmine/Rakefile redmine:email:receive_imap RAILS_ENV="production" host=imap.mail.ru port=993 ssl=SSL username=mail.ru password=password -r 'openssl' -E 'OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE'

redmine-email.log
/bin/readmail.sh: rake: not found

Please tell me what to do to crontab/script began to work


Replies (2)

RE: Cron not reading mail - Added by Akiko Takano almost 10 years ago

Please try to set the absolute path for rake command in your readmail.sh script.

  • To get absolute path, run command: “which rake”.

RE: Cron not reading mail - Added by Роман Лебедев almost 10 years ago

Akiko Takano wrote:

Please try to set the absolute path for rake command in your readmail.sh script.

  • To get absolute path, run command: “which rake”.

Its a works!
Thanks.

    (1-2/2)