Authenticate in web app and drop a script in a directory and run them with cron maybe?
Authenticate in web app and drop a row in a table and let a long running process suck the row out and kick something off in a thread pool?
I've seen both. You've got to monitor both somehow. The second one is much more work but lets you do more with the output and gives you a nice thread pool. There might be a simple bash-ie way to make a thread pool, but I don't know it.
--Nik