Fan Zhen Coder & Teacher

Mac下实现OmniFocus和Redmine同步

2014-03-06

可以将Redmine中指派给你的任务,同步到OmniFocus中,文件夹为nerd,每个项目单独列出,任务名一般为:RM#issue_id:......,链接放在备注中,很方便。如果在Redmine中关闭任务,OmniFocus同步后,也会Check掉。

安装,要用到omnifocus.gem和它的插件:omnifocus-redmine.gem,当然还有许多插件支持各种BTS (bug tracking systems):github, bugzilla, pivotaltracker, redmine, rt, rubyforge

gem install omnifocus omnifocus-redmine

可能还需要iconv gem install iconv

使用方法:

  • 新建项目或任务

% of new

usage: of new project_name title        - 新建项目任务
       of new nil          title        - 新建inbox任务
       of new project      project_name - 新建项目
  • 与OmniFocus同步

% of sync 第一次运行会生成一个 .omnifocus-redmine.yml 配置文件,修改如下:

user_id: 20
redmine_url: http://redmine.me/
username: fanzhen
password: 1234
queries: 
just_project: false

通过 whenever 添加定时同步到 crontab, 具体可查看我上个Blog

% cat rake file
desc "OmniFocus sync with redmine"
task :ofsync do
  	sh  "of sync"
end

% cat config/schedule.rb
every 2.hours do 
  	rake "ofsync"
end

% crontab -l
0 0,2,4,6,8,10,12,14,16,18,20,22 * * * /bin/bash -l -c 'cd /Users/fanzhen && RAILS_ENV=production rake ofsync --silent' 

另,MAC系统推荐用Launchd来代替cron,于是找了个工具Lingon编写相应的plist

/bin/bash -l -c "cd /Users/fanzhen && RAILS_ENV=production sudo rake ofsync --silent"

Similar Posts

Comments