• (cs)

    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.

  • Rob (unregistered)

    twitch

  • SomeCoder (unregistered)

    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.

  • (cs)

    "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.

  • Calli Arcale (unregistered)

    "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.....

  • Someone (unregistered)

    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.)

  • (cs)

    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.

  • (cs) in reply to akatherder

    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 :)

  • IHaveNoName:-( (unregistered) in reply to Someone
    Someone:
    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.)

    Well, all you've got to do is accessing the web site at specific times. This can be easily done with the windows task manager oder cron. And if you do this you can easily move the cron emulator in its own page and do what Frank did, but make it automatic.

  • RandomVisitor (unregistered) in reply to akatherder

    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... ?

  • (cs)

    "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

  • (cs) in reply to IHaveNoName:-(
    IHaveNoName:-(:
    Someone:
    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.)

    Well, all you've got to do is accessing the web site at specific times. This can be easily done with the windows task manager oder cron. And if you do this you can easily move the cron emulator in its own page and do what Frank did, but make it automatic.

    Great WTF article, and even greater WTF comments! A classic all around!

    WTF++

  • hex (unregistered) in reply to Rank Amateur

    ++?????++ Out of Cheese Error. Redo From Start.

  • (cs) in reply to Rank Amateur
    Rank Amateur:
    "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

    Mr. Goldberg would be proud.

  • geoelectric (unregistered) in reply to hex
    hex:
    ++?????++ Out of Cheese Error. Redo From Start.

    Pipe down, Wallace, and get me that TPS report.

  • (cs)

    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?"

  • (cs) in reply to pitchingchris

    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!

  • Feyr (unregistered)

    sounds like the kind of code someone would write here

    /goes back to harrassing them about proper external argument validation

  • Chris Harmon (unregistered)

    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 :)

  • Spastic Weasel (unregistered) in reply to hex

    Ponder Stibbins FTW

  • Spastic Weasel (unregistered) in reply to hex

    Ponder Stibbons FTW

  • (cs)

    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.

  • Anon (unregistered) in reply to It's a Feature
    It's a Feature:
    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!

    Don't laugh. That's how Drupal, a popular open source CMS, works.

    (It's even the CMS that Tim Berners-Lee uses for his blog. Yes, that Tim Berners-Lee.)

  • foo (unregistered) in reply to akatherder
    akatherder:
    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.

    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.

  • ex-amatuer (unregistered)

    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)

  • (cs) in reply to Someone
    Someone:
    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.)

    Wikipedia does this. http://en.wikipedia.org/wiki/Help:Job_queue.

  • (cs) in reply to Random832
    Random832:

    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."

  • (cs)

    I've seen this done using Active Desktop with daily synchronization instead of a browser, which I suppose kind of automates things.

  • Luciana (unregistered)

    I can't believe it, he did all that manually?!

  • (cs) in reply to KattMan

    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.

  • elan (unregistered)

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

  • An Unhandled Exception Was Thrown (unregistered)

    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.

  • Andrew (unregistered) in reply to zip
    zip:
    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 :)

    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.

  • Stavron (unregistered) in reply to Andrew
    Andrew:
    I don't know to make PHP spawn a child process.
    Try http://php.net/pcntl_fork :)
  • (cs) in reply to Andrew
    Andrew:
    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.

    pcntl_fork()/pcntl_exec() are how PHP exposes those system calls. Took a quick search for 'fork' on the online PHP manual.

  • The Intern (unregistered)

    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 :)

  • The Intern (unregistered) in reply to The Intern
    The Intern:
    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 :)

    tree = "three"

  • (cs)

    that's no WTF! That's brillant! :)

  • Fry-kun (unregistered)

    WTF Workaround: If you don't have access to cron, just curl the main page every so often, using another computer's cron.

    :D

  • Pat (unregistered) in reply to Rank Amateur
    Rank Amateur:
    "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

    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.

  • Durak (unregistered)

    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.

  • (cs) in reply to Anon
    Anon:
    It's a Feature:
    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

    Don't laugh. That's how Drupal, a popular open source CMS, works.

    (It's even the CMS that Tim Berners-Lee uses for his blog. Yes, that Tim Berners-Lee.)

    When you invented the hammer, everything looks like a nail...?

  • (cs)

    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."

  • (cs) in reply to Andrew
    Andrew:
    Use CGI to spawn your own cron-daemon, that reads a flat-file list of scripts.
    Spiffy, unless your web host automatically kills processes that have been running a certain amount of time (think DreamHost - though they do have cron).
  • Samn (unregistered)

    Free webcron - http://www.webcron.org/

  • pfarrell (unregistered) in reply to Calli Arcale
    (and praying that my ISP wouldn't revoke my IP address in the middle of it)

    Dude... man nohup

  • Chi (unregistered) in reply to Rank Amateur

    That one made my day -- thank you! :-D

  • (cs) in reply to pfarrell
    pfarrell:
    (and praying that my ISP wouldn't revoke my IP address in the middle of it)

    Dude... man nohup

    Dude... no quack either.

  • (cs) in reply to hex
    hex:
    ++?????++ Out of Cheese Error. Redo From Start.

    This might cause a round world error...

    Anyone know where we can find room 2B?

  • Sid2K7 (unregistered) in reply to Kain0_0
    Kain0_0:
    hex:
    ++?????++ Out of Cheese Error. Redo From Start.

    This might cause a round world error...

    Anyone know where we can find room 2B?

    Of course. Its shown on the map. Maps are available in Room 2A and only require filling out form A-38.

Leave a comment on “The Batch Process Manager”

Log In or post as a guest

Replying to comment #:

« Return to Article