【发布时间】:2016-09-14 13:56:15
【问题描述】:
我必须在 Redmine 上设置一个 Cron 作业来自动管理 IMAP 获取。我尝试提供尽可能多的关于我的环境的信息:
Redmine version 3.2.0.stable
Ruby version 2.1.5-p273 (2014-11-13) [x86_64-linux-gnu]
Rails version 4.2.5
Environment production
Database adapter Mysql2
我已将luismaia/redmine_email_fetcher 安装为插件,并已将其配置为 gmail IMAP。到目前为止,我没有收到任何错误消息,并且通过在 Redmine 上尝试测试工具,我收到了成功消息。
Redmine上的插件配置我总结如下:
Configuration type: IMAP
Is configuration active? true
Host : imap.gmail.com
Port: 993
SSL? yes
Email username: mailAddress
Password: mailAccountPwd
Folder Name: Inbox
Method for unknown users: accept
现在,我必须运行一个 Cron 作业。在这个链接:
https://github.com/luismaia/redmine_email_fetcher
我发现了以下内容:
*/5 * * * * www-data /usr/bin/rake -f /opt/redmine/Rakefile --silent redmine:plugins:email_fetcher:fetch_all_emails RAILS_ENV=production 2>&- 1>&
我将其个性化如下:
*/5 * * * * www-data /usr/bin/rake -f /opt/redmine/Rakefile --silent redmine:plugins:email_fetcher:fetch_all_emails RAILS_ENV=production host=imap.gmail.com username=mailAddress password= mailAccountPwd port=993 --trace
切入正题:上面的那行行不通;我不知道为什么。
我可以补充一下:
- 在
/usr/bin我看到rake2.1 -
opt目录 (/var/opt) 为空。
我确实希望我以体面的方式解释了我的问题。
提前谢谢你,真的。
ps: 我也试过了:
*/5 * * * * www-data /usr/bin/rake2.1 -f /var/www/redmine/Rakefile redmine:plugins:email_fetcher:fetch_all_emails RAILS_ENV=production 2>&- 1>&-
但什么也没发生。
【问题讨论】:
标签: cron task rake redmine jobs