Live data from Hacker News

Ask HN: What is the cheapest, easiest way to host a cronjob in 2022?

news.ycombinator.com

181–190 of 336 posts

Re: Ask HN: What is the cheapest, easiest way to host a cronjob in 2022?

#182
post #12

Github actions FTW! > https://docs.github.com/en/actions/using-workflows/events-th... I remember seeing a couple projects shared before, using this technique to scrape sites with GHA

Just note that they’re not guaranteed to be called precisely on time, e.g. my “every 15m” CRON job will be called every 15m _at best_, in practice… twice per hour. This works perfectly for my case (content syndication for https://potato.horse ), and I’m pretty happy with GH actions for this kind of stuff, but if you need something more precise, you might want to look somewhere else.

> Just note that they’re not guaranteed to be called precisely on time, e.g. my “every 15m” CRON job will be called every 15m _at best_, in practice… twice per hour

Is the spread really that egregious? That's essentially a 50% failure to trigger at all, like I don't think you can call that 15 minutes so much as 15±10 minutes lmfao

IIRC AWS EventBridge is also not guaranteed to execute on the exact minute, but in my experience running a small job every 5 minutes only had about a 30-40 second delay at worst.

Re: Ask HN: What is the cheapest, easiest way to host a cronjob in 2022?

#184
Agreed that most of the solutions are still tough to implement in production. Plus, a lot don't have built-in logging, error-handling, notifications, version control, package management, etc. Those are the "gotchas" that you won't notice until things inevitably go wrong.

It's worth checking out Shipyard (https://www.shipyardapp.com). I'm the co-founder and designed it to be the easiest way to deploy scripts/workflows in the cloud. You can schedule any code to run our platform (native support for Python, Node.js, Bash) and build reusable templates.

Our free dev plan allows for 10 hours of free runtime per month which is plenty for most use cases. If you want more or need webhooks/API, that starts at $50/month.

Feel free to contact if you want to learn more. Email is in my profile.

Re: Ask HN: What is the cheapest, easiest way to host a cronjob in 2022?

#186

I'm not sure what you mean when you say there is no easy solution... procure a small vm on Linode or your choice of provider for like $20/mo. SSH into it, set up the crontab to run your web scraping script. I could literally have that set up and running in 15 minutes flat. EDIT: after reading the other solutions in this thread I'm blown away by how much people are over thinking and over engineering this. KISS people.

How much could a banana cost? $10?

funniest show ever

Re: Ask HN: What is the cheapest, easiest way to host a cronjob in 2022?

#188
post #108

Most folks here are focusing on the scheduling part, but change detection means you need some way to persist state (or have a long running process that keeps state in memory). While you could do FaaS (e.g. AWS Lambda) + another service for state (e.g. S3/RDS/EFS), that seems like overkill. Even today I would still do it the old way: store state in a filesystem (maybe SQLite if you have more complex needs), and config…

> If your answer is: ok, so you just need to create an AWS account, dockerize your script, put it in a Lambda which is hooked up to RDS, trigger lambda through EventBridge and connect it to CloudWatch... then there's something wrong with you. There must be a better way to reliably run a fucking 10 line script in the cloud. I mean, you don’t have to dockerize it, and I would use S3 or Dynamo for state, but otherwise i…

I do a lot of serverless development and agree with you on this. This is a very simple and cost effective problem for lambda and EventBridge.

Re: Ask HN: What is the cheapest, easiest way to host a cronjob in 2022?

#189
post #134

I use Serverless with Lambda. It's even a template in Serverless, so with the CLI you just type `serverless` and select the Node.js/Python Scheduled Task template and everything is set up for you. I do a lot of web scraping, and Lambdas are very useful for web scraping since their IPs can change for each request. For deployment, you can just do `serverless deploy` or set up a GitHub action each time you push to main.

No post body was provided.

Re: Ask HN: What is the cheapest, easiest way to host a cronjob in 2022?

#190

I'm not sure what you mean when you say there is no easy solution... procure a small vm on Linode or your choice of provider for like $20/mo. SSH into it, set up the crontab to run your web scraping script. I could literally have that set up and running in 15 minutes flat. EDIT: after reading the other solutions in this thread I'm blown away by how much people are over thinking and over engineering this. KISS people.

as the comic strip says, “Here’s a nickel kid, buy yourself a better computer”
Post reply on HN