views:

157

answers:

3

Say a client is happy with the work you've done creating a script to accomplish a task that gathers some information and outputs a hefty database file. Then, they're interested in having the task run periodically (approximately monthly) without human intervention. The client is not interested in running the task locally, so you're forced to find somewhere else to do it -- somewhere, as hokey as it sounds, "in the cloud."

What techniques/services would you use to accomplish this cheaply?

Things I've explored so far:

  • Amazon EC2. Sounds like a good idea, but there's no obvious way to stop and restart instances on a schedule. Paying >$70/month to keep an instance running cron but doing nothing useful seems like a waste.
  • Bite the bullet and pay for a Virtual Private Server (VPS). Again, though, even paying $20/month (Slicehost, for instance) seems like overkill if the task is only going to be running a few hours out of every month.
  • A shared hosting account and WebCron. Seems a little MacGyverish and possibly violating the ToS of many shared hosting services, which don't often take kindly to long-running tasks.

Do you have experience with these or any other options?

+7  A: 

I would use Amazon EC2. Just fire up an instance, copy the script to the instance, add it to the start up routine and append a shutdown to the end of the script. Bundle it into your own image and shutdown the instance. Now you can just fire up your own image monthly and it will execute the script and shutdown. You will only pay 10¢/hour with a m1.small instance.

You just need someone manually starting the instance monthly or have your client install a small monthly cronjob to start the instance.

Note: shutdown -h is required, otherwise instance will reboot instead of halt

Samuel
A: 

Running the task itself on EC2 actually sounds very relevant, but running the cron itself on EC2 is indeed waste.

I can't think of how to run the cron on a machine that isn't yours.

orip
+1  A: 

I'd bite the bullet and get a VPS, after 6 months you'll almost certainly find that you've found a lot more uses for it.

I use a shared hosting service that allows this, and use it for a nightly sync.

Richard Harrison
Sounds like a friendly host... is it a well-kept secret or can you share a link?
adrian