Live data from Hacker News

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

news.ycombinator.com

311–320 of 336 posts

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

#311

I feel like maybe this problem was "solution first". A cronjob is a solution. For example, Supabase supports cronjobs, but it can't be used to take screenshots. This might be a non-answer, but if you just want "scheduled notifications of a website change", then you can use something completely purpose built for that. There is a Github action that does exactly this: https://github.com/yasoob/github-action-scraper-tuto…

As a supabase enthusiast I take this as a direct challenge.

I like it too and I think you might be able to accomplish this with that extension that allows HTTP requests in your postgres statements but I haven't looked into it

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

#312
I recently had some smallen private projects and I reasearached and tried out a lot of services. I needed cron jobs to run Node.js scripts properly.

My use cases have been: - Web Scraping of some websites to check stock availability of a product (4 times a day). - Web Scraping of a website to get an apppointment at a specific citizen office (every 5 seconds). If success then send a Telegram Chat Bot message to me.

The second use case was a bit tricky, because my IP was kicked frequently from the server, I tried out what the sweet spot timing for the ping was and my setup (all jobs with different IPs) was the following:

1. setup on my Raspberry Pi in combination of the package PM2 (PM2 is a daemon process manager that will help you manage and keep your application online 24/7)

2. setup on Render (https://render.com/) Advantage here was the very convinient, quick and easy setup. I was able to link my Github Repository to it and the Cron Job would re-build the program automatically whenever a new master version on GitHub was available. I used an in-memory TypeScript job scheduler library in my project that repeatedly executes given tasks within specified intervals of time (e. g. "each 5 seconds") until 7 PM and I let the scron job service execute the script again at 7 AM in the morning. Debug Print Console inclusive.

3. setup on EvenNode (https://www.evennode.com/docs/cron-jobs) Here the upload of my node.js script was done via FileZilla to the FTP-Server of EvenNode. Linkage to GitHub Repository is also possible but since I am not that familiar with the private key setup at GitHub I chose the FTP-Server option. I used an in-memory TypeScript job scheduler library in my project that repeatedly executes given tasks within specified intervals of time (e. g. "each 5 seconds") until 7 PM and I let the scron job service execute the script again at 7 AM in the morning. Debug Print Console inclusive.

Both online Service were very cheap, paid cents only. The Raspberry Pi solution was for free (only energy consumption). I can highly recommend render.com and evennode.com for cron jobs.

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

#313
post #257

Earlier quoted context omitted.

It's true that you don't, but I can see the advantages. I have a Raspberry Pi that is natively running a scraper using headless Chromium and cron. It works great, except.... I ended up needing a virtual framebuffer. I got it working on the Raspberry Pi, but I got a new workstation and wanted to edit my script and test it there. I got cryptic errors that I needed to debug to understand they were framebuffer issues, th…

Why couldn't you keep editing your script in your Pi? Isn't proposing Docker as a solution to this going nuclear? I think there are some many cheaper things you can do to solve this. For me this is absolutely no justification for Docker use in this scenario.

The script takes 60+ seconds to run on an RPi and fewer than 10 on an i9, allowing for significantly faster iteration.

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

#315
post #230

Earlier quoted context omitted.

Basic plan is $35/m which is much higher than alternatives discussed in this thread, isn't it?

Especially seeing as you can outright have a full, tiny VPS 24/7 for $2.50/mo or $30/yr from Vultr. I suppose there's a value add in terms of not necessarily needing to setup your own install, but if that's something you're comfortable with I don't quite see the point.

You're right, this is more expensive than VPSs alternatives.

We assumed commercial use cases for that price so the benefits of not having to deal with servers complexity + access control + etc.. are quickly paid back.

For hobby projects, we are thinking of creating a free plan

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

#316
post #2

Sounds like a task for a cheap VPS

Sometimes you get cron jobs with a cheap webhost, so you would not even need to maintain a cheap VPS

Maybe they're out there, but I cannot recall the last time I saw a webhost for less than Vultr's starting $2.50/mo

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

#317
post #257

Earlier quoted context omitted.

Why couldn't you keep editing your script in your Pi? Isn't proposing Docker as a solution to this going nuclear? I think there are some many cheaper things you can do to solve this. For me this is absolutely no justification for Docker use in this scenario.

The script takes 60+ seconds to run on an RPi and fewer than 10 on an i9, allowing for significantly faster iteration.

Doesn't really answer any of the questions of what docker actually does to help here, other than make everything slower and more complex.

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

#318

Earlier quoted context omitted.

As a supabase enthusiast I take this as a direct challenge.

I like it too and I think you might be able to accomplish this with that extension that allows HTTP requests in your postgres statements but I haven't looked into it

Haha I actually tinkered with it a bit.

One thing I love about supabase is that they are focused. They have a ton of features, but they're cohesive in ways no one else has managed. You can manage your document storage, their built-in auth provider, and websocket updates ALL IN SQL.

And now their QETL and remote servers?? (https://supabase.com/blog/postgres-foreign-data-wrappers-rus...) And their CDN and Image processing???

It is shocking and almost painful how beautiful this all is. And how with those basics, you could almost do anything. But yeah, I think the only thing between Supabase and Web Scraping Screenshots is a Postgres Plugin, entirely independent of what Supabase provides.

If I were one of those beautiful people who write a blog about rasterizing on a e-pregnancy tests, I'd give it a shot haha

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

#319

Any cheap vps linux box will have cron and mail sending utils installed and ready to go.

Some boxes come with systemd, which has its own scheduler, but not cron. This is not a big deal but I was somewhat confused the first time I saw it.

I'll admit, most of my linux admin experience predates systemd.

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

#320
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.

Quoted post unavailable.

We've banned this account for posting unsubstantive and/or flamebait comments. Please don't create accounts to break HN's rules with.

https://news.ycombinator.com/newsguidelines.html

Post reply on HN