Question

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?

Was it helpful?

Solution

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'
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top