Rails: how to run cron jobs in a cost-wise way

Hello,

I have been reading quite a few posts about running cron jobs on fly.
To be honest i’m a little confused about what would be the best approach in order to have a simple cron job responsible for checking specific db items once in a while (let’s say every day at a specific time) and delete some accordingly.

I know the heroku approach where you need a separate machine running permanently just for the sake of performing this check.

I have read that I could use fly to use scheduled machines as mentionned in this post.

My question is then the following:

  • do i need to deploy a new project from the repo where the cron job exists in order to make that happen?
  • is there an up-to-date documentation with clear steps I could follow in order to make that happen?
  • as mentionned in the title, a coast-wise approach would fit us as we will already have high coasts on fly, hence, I’d like to be able to dedicate only the required amount of ressources.

Sorry if this is a duplicate, I’m looking forward to hear from you.

Sincerely

Paul

No, you can run the command on a daily cadence to execute your job.

Yes but it sucks:

The cost should be minimal since all you’re doing is reading and writing to a db right? But it should be relative to how big the db operations are.

2 Likes

Thats awesome, thank you very much for taking the time to reply.
i’ll go with this approach then. Probably gonna tackle this feature in the next days, I’ll post detailled steps along the way if tread isn’t clsoed yet when i start.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.