How to use cronjob

hey everyone i want to send mails by scheduling the time
dynamically.lets say in a single table i have all the employee logs
who came at different timings.they are from different locations and
departments. i want to send mails to different mails ids according to
there location to there HR. can i do this with cron job.

thanks in advance

On Tue, Apr 10, 2012 at 11:16 AM, honey ruby
[email protected]wrote:

hey everyone i want to send mails by scheduling the time
dynamically.lets say in a single table i have all the employee logs
who came at different timings.they are from different locations and
departments. i want to send mails to different mails ids according to
there location to there HR. can i do this with cron job.

thanks in advance

I’ve seen this cast

and it has its revised episode, maybe it helps, or just go to see the
documentation of the whenever gem

JavierQ.

A better approach I believe is to use redis/resque to queue the emails
to be sent – and then use resque-scheduler to schedule the jobs to
run whenever you want them to run.

There are a bunch of reasons why redis is a better approach to queuing
work in general, so I’d look into this.

What you want is:

  • redis installed on the machine

  • The gems:

resque
resque-mailer
reque-scheduler

Here’s a pointer to the current set of resque plugins – you’ll find
the scheduler and mailer plugins described there.

Good luck.