Forums

Scheduling frequent cron tasks (every 1-2 minutes)

Hi All,

I built an email automation app, and would like one of the scripts in it to run approximately every 2 minutes. Is there a good way to schedule tasks this frequently using the PA interface? I don't particularly want to add 30 new "Scheduled Tasks" by hand, seems overly laborious. Any ideas? Any reasons to not schedule tasks this frequently?

Thanks! Bjorn

Unfortunately I don't think there's an easy way to do that, apart from the dull job of adding 30 separate tasks.

As a one-off -- if you send us a list of the times and the path to the task command line via "Send feedback" perhaps we can bulk-import them into the scheduled task database on the backend.

Couldn't you use time.sleep() in your script?

I read earlier that processes can run for up to an hour, or 6 hrs for paid accounts on PA, so have it sleep for 2 mins multiple times and run it every hr.

Right -- an hourly task that loops with a time.sleep(120) sounds like it might work? Check out this guide to long-running tasks if you haven't already...

Great idea, thanks! I'll give it a go and post back if there are issues.