High-frequency cron jobs


#1

I have a cron job running every 5 minutes, and I’d like to kick up the frequency to once every minute. However, if I try selecting all the minutes on the Custom -> Minutes menu, the response is an error (“Too many minutes selected”). Is there a way for me to implement this manually? I’m not too experienced in creating cron jobs, so I’m not sure how well I would do outside of the DreamHost control panel.


#2

See Crontab - Wiki

But keep in mind that if you try that on shared hosting, it might not work. There’s no official word that I can find but a few people have claimed they can’t get commands to run that frequently. Needing to run a command that frequently might be a sign you need to consider doing things differently as well.

Customer since 2000 :cool: openvein.org


#3

Familiarise yourself with cron jobs before doing anything. One mistake in an automated script that leads to excessive CPU usage could result in your account being switched off to protect other accounts, or see you bustled onto a PS that you might not really require if you’re on a shared server.

What is it that you want to run every minute, and why?

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost


#4

I’m creating a Twitter app that requires checking Twitter for mentions of my account, then processing those tweets and either reposting or redirecting them. The cron job just runs a small java jar file (200-something KB, I think), which performs all the necessary functions via the Twitter API. I’m pretty sure there’s no way to have Twitter automatically process the tweets as they come in, since that would likely involve coding on the twitter server itself, not on the client end.

Anyway, updating every 5 minutes seems to be okay for now, but I just got whitelisted by Twitter (no more rate limiting) so I thought I would take advantage of my newfound freedom and have the software update more frequently.

(I should mention that the java program takes only a few seconds to run, and I don’t think it eats up too much CPU power/time…)


#5

Sounds like a really useful application. Everyone loves automated stuff!

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost


#6

Haha, hope that wasn’t sarcasm (never sure on the internet). If you’re curious, the project is http://twitter.com/TongueTip. I’m trying to see if I can use Twitter as a platform for crowdsourcing thesaurus requests… a fun little experiment.


#7

Haha no sarcasm, the sentiment is genuine. I haven’t been bitten by the Twitter bug myself, but do have a lot of “online buddies” who use it. No doubt I’ll create an account one day.

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost