Live data from Hacker News

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

news.ycombinator.com

201–210 of 336 posts

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

#202
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

https://simonwillison.net/2020/Oct/9/git-scraping/

Simon Willison has a bunch of examples of scraping sites with GHA and storing the results in a repo. But you can use the same technique without the storing part if need be.

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

#203
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…

[deleted]

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

#204

It amazes me that for such a relatively simple thing everyone's knee jerk response is THE CLOUD!

Yeah why can't my phone or tablet do something simple like this.

Your phone or tablet is not always on

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

#205
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…

"you need some way to persist state (or have a long running process that keeps state in memory" Hash the data, update the script with the hash.

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

#206

It amazes me that for such a relatively simple thing everyone's knee jerk response is THE CLOUD!

It’s the easiest and cheapest way unless you have an existing raspberry pi or something. Your personal devices are probably not always on.

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

#208

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.

Overthinking it? Your solutions costs $240/year. There are solutions out there that would probably bring that under $20/year, and be more reliable than your VM that falls over when it's full of logs (at some indeterminate future date). 10x+ savings with greater reliability isn't "overthinking it", it's a greatly improved solution.

I charge my clients $550 an hour, so a $240 a year solution which takes 15 mins to set up is what I would choose over the time consuming alternatives offered.

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

#209
post #193

Earlier quoted context omitted.

The default branch on GitHub has been main for over 2 years. https://github.blog/changelog/2020-10-01-the-default-branch-...

I thought the change from "master" to "main" was silly and didn't actually help fight racism, but if you're still butthurt about it two years later, it means you're a racist.

[deleted]

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

#210
If you are comfortable using AWS , You could us AWS Batch (free) with Spot Fargate jobs with Cloudwatch cron as the trigger . You only pay for the vcpu hours your job consumes https://aws.amazon.com/fargate/pricing/ , it’s a set it up once and forget it model.

You could use lambda if your runtime is expected to always be less than 15 minutes Batch fargate jobs documentation - https://docs.aws.amazon.com/batch/latest/userguide/fargate.h... Cloud watch cron documentation

https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/S...

https://aws.amazon.com/about-aws/whats-new/2018/03/aws-batch...

Everything can be deployed as a simple cdk app once you have your code ready in a docker repository somewhere . There are no servers to maintain and no ongoing maintenance will be necessary

Post reply on HN