- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Think of all the time he'll never get back because he has to go send all the jobs manually.... Not to mention it sent everything down to one point of failure, so if Frank goes into a coma for awhile, we just can't get cards then. You'll get him once he comes out of it.
Admin
twitch
Admin
jaw drops
That's.... awful. Though honestly, I've had a few "automated" processes that required me to click a button once a day. The thing is, this process was temporary and going away after a few weeks so I just kept doing it for the few weeks. For anything that is for production, that's unacceptable.
Admin
"Yes, sir, I have to surf the Internet at least once a day. It's vital to the company's survival."
Damn, that's smooth. I have to try that.
Admin
"Practically every day."
I'm worried.
:p
Seriously, I once wrote a script that I was having a devil of a time getting to work under cron. It was the first scheduled task I'd ever attempted, so it took me a while to discover some of the pitfalls (it runs in sh, and your resource file isn't run by default). In the meantime, I was kicking it off manually from a loaner laptop in the evenings (and praying that my ISP wouldn't revoke my IP address in the middle of it). I eventually added a feature to make it sleep for a specified number of hours so I wouldn't have to stay up until 11, and then eventually I nailed the last stupid bug that was keeping cron from successfully running it. Today it runs automatically.
But at least I knew it was a bad long-term strategy.....
Admin
I've seen this sort of thing on websites that are hosted cheaply in a multihosting enivironment, where you have PHP and MySQL, but no cron (or atleast no access to it). What they did was write a short snippet of code vaguely emulating cron's behavior and including it at the bottom of every PHP page of the site.
It actually worked nicely as long as they had traffic. (Although the cronjobs mustn't get too long or it would show up in the page load times or, worse, run into PHP's configured limit for the running time of a script.)
Admin
Hmm, I did this once when I didn't have access to schedule tasks. I think it was a tracking/logging mechanism to take a daily snapshot of some data at a given time.
With the limited access I had, I'm not sure there was a better way. It worked fine for me though.
Admin
Yep, I've been guilty of this kind of thing, for the same reason as other posters have mentioned -- needing scheduled functionality in a php/mysql environment where my host wouldn't let me do anything.
so, just check to see if it's time for your "job" on every page load...
Does anyone know of a better way to do this? I guess a cron job on my local machine invoking a page load once a day would be better, in case I wasn't getting any traffic :)
Admin
Admin
T.I. used to be an intern at an IT-department. Who would've thunk it? Although this might not be the same T.I. in the music business... ?
Admin
"There's a way to schedule tasks?" Frank replied, surprised.
Of course there is a way. Dripping faucet drips into bucket on seesaw. When bucket is heavy enough, seesaw tips lifting lid off cheese plate. Mouse runs out of hole to eat cheese. String tied to mouse tail pulls crank that pushes pencil into CPU power switch. Computer boots and runs browser from Startup menu. When mouse is full, he runs back to his hole, where a piezoelectric switch starts an electric motor that turns a paddle wheel scooping water out of the bucket and onto the floor. Water runs into surge protector, shorting it out and shutting down the computer. Bucket returns it’s original position. Paddle wheel stops when mouse gets hungry (and loses weight). Water dries, leaving power available for the computer.
Really quite elegant.
--Rank
Admin
Great WTF article, and even greater WTF comments! A classic all around!
WTF++
Admin
++?????++ Out of Cheese Error. Redo From Start.
Admin
Mr. Goldberg would be proud.
Admin
Pipe down, Wallace, and get me that TPS report.
Admin
I'm pretty sure I used to work with "Frank"...
Them - "...but we can just run the DB script every morning when we come in. It only needs to be run on weekdays."
Me - restraining 'fist of death©'.
Them - "What's wrong with that vein on your neck, and the other 3 on your forehead?"
Admin
How simple! On the web server, just put a job in the task scheduler that runs once a day with this in the commandline:
http://localhost/dispatchqueued.asp
And the WTF will live on!
Admin
sounds like the kind of code someone would write here
/goes back to harrassing them about proper external argument validation
Admin
Wow - I remember seeing that being done! It was 7 years ago, but still. The guy didn't know about Scheduled Tasks and running VBS scripts, but knew how to write an ASP webpage and would just open the webpage when needed. I think he later figured out a way to open webpages via scheduled task too :)
Admin
Ponder Stibbins FTW
Admin
Ponder Stibbons FTW
Admin
He he. Reminds me of the (optional, thankfully) manual queue processing mode that's in phplist. I think it uses a meta refresh or some such to handle the repeating interval so you can use the thing in a reasonable fashion on a host without cron access.
Admin
(It's even the CMS that Tim Berners-Lee uses for his blog. Yes, that Tim Berners-Lee.)
Admin
Right up until the next time you need an "automated" script to run daily. I am picturing this consultant after a few years starting up Firefox with 100 tabs to fire off different "daily" processes.
Admin
I will admit like the rest of you to doing this as well.
It was one of my first jobs, about a year after college (tells you a bit about the job market back then - circa 2000), where a guy asked to have a shopping cart site built, and I said "Sure, I can do that".
This was with asp and an access database. So one of the requirements was to send an email in the morning of all of the previous outstanding orders. I had no clue how to schedule anything, so luckily they had a techie there who scheduled the page to be open daily.
Thank God those days are long behind me - now I'll just simple schedule Terminal Services to my prod server, which would have IE set as the deault application to run on log in, which in turn would have this set as my home page. (I know not quite as creative as Rue up above)
Admin
Wikipedia does this. http://en.wikipedia.org/wiki/Help:Job_queue.
Admin
Don't you love how the documentation for the application is contained within the application itself?
User: "How do I use wiki?" wikiDev: "Use wiki to look that info up."
Admin
I've seen this done using Active Desktop with daily synchronization instead of a browser, which I suppose kind of automates things.
Admin
I can't believe it, he did all that manually?!
Admin
It's not as if actually navigating the help system is any more complicated than reading any other webpage. The documentation is for when you need to know something specific to it, like, how to edit a page, or what people are talking about when they say "the job queue ..." or something.
Admin
I remember working at a certain company where a credit card collection process runs in a asp page that refreshes itself. The ops people have to make sure there is a copy of IE running that page on a certain server all the time...
Admin
That's the best: put a javascript timeout in the page so it reloads by itself, then just let IE automagically keep things afloat.
Or maybe not. Or more likely just to be funny and torment someone else. I know, use that method ONLY for clients you hate.
BTW, my company's intranet runs on ColdFusion 4.5, where the scheduler -- you guessed it -- calls pages to execute any scheduled ColdFusion task.
Admin
I can think of a few ways to make CRON events when the ISP restricts CRON. You have access to PHP, CGI, and the SQL database.
Use CGI to spawn your own cron-daemon, that reads a flat-file list of scripts. This is easy to do using Perl fork/exec. I don't know to make PHP spawn a child process.
Some SQL databases have built-in jobs-handlers. For example, Oracle has DBMS_JOB. I'm not sure what MySQL offers.
Admin
Admin
pcntl_fork()/pcntl_exec() are how PHP exposes those system calls. Took a quick search for 'fork' on the online PHP manual.
Admin
Original submitter here. I should also mention that simple config changes by the user required tree round-trips to the server to validate. Fun times, fun times.
PS- Hi Ronnie :)
Admin
Admin
that's no WTF! That's brillant! :)
Admin
WTF Workaround: If you don't have access to cron, just curl the main page every so often, using another computer's cron.
:D
Admin
I seem to recall an episode of the Simpsons where Homer left a drinking bird continually pressing the 'Y' key on his computer. Now that's truly a robust solution.
Admin
Hmm, I kinda doubt the original story that the guy didn't know you could automate the process. I the reality was the he was strapped for time and probably couldn't devote the necessary it required to write the code, debug it, and then maintain. It was just easier for him to press buttons at night before he went to bed.
Admin
Admin
Back when I was a co-op, we had a database server that would have connections time out. But the catch was it would only do it once, then work fine, and only if the server hadn't seen any action for awhile. At the same time I happened to be writing a webpage that would ping all our servers as well as pull data off of environmental monitoring units so we could check our network status easily. And it just so happened that that pinging would be enough to keep the database server from doing it's timeout thing.
So a quick add of a meta refresh tag, along with using active desktop to make my background that webpage, and we no longer had timeout issues.
It also led to something far more wtf-y. I was always the first to know when a server was down. So I'd stop by my boss's office to let him know to which he'd reply "Has anyone called about it? No? Then it's not really down."
Admin
Admin
Free webcron - http://www.webcron.org/
Admin
Dude... man nohup
Admin
That one made my day -- thank you! :-D
Admin
Admin
This might cause a round world error...
Anyone know where we can find room 2B?
Admin
Of course. Its shown on the map. Maps are available in Room 2A and only require filling out form A-38.