Dec 24, 2009

Running the background task with cronjob

Background processes are a regular need for any website. Specially when there are emails to be sent to the administrator every evening 1t 7.
Many developers have contributed to develop the plugins for running background processes, but because of some reasons none could be executed in my computer. So I went to the traditional way and used cronjob to run my background process in my Ubunto 9.10 server.

Here are the steps I followed
1> First I coded a bash script so that later I could just run a single command to run all my tasks
( to run ruby on rails code you need to use script/runner or script/console)
2> then I set proper time to run my background process(crontab -e)

Some also suggested to use thread.As I had my job done with cronjob I didn't bother to research further.

No comments: