質問

Suppose, we have a rake task, to be run like,

rake RAILS_ENV=development parse_and_insert_feed_in_db

We can set this task to be execute repeatedly on server using crontab's.

1 0 * * * rake RAILS_ENV=development parse_and_insert_feed_in_db > /some/dir/file.log

How can we set a rake task to be executed on local machine like we set cron on server?

役に立ちましたか?

解決

Please try like this:

1 0 * * *  /bin/bash -l -c 'cd /home/your/Application/path && rake RAILS_ENV=development parse_and_insert_feed_in_db > /some/dir/file.log'
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top