Take photo from SSH?

I'd like to use an old iPhone as a security camera, taking photos every X seconds and copying them off to a remote server. The biggest hurdle I've found is triggering a photo from the terminal. Is there a built-in command or jailbreak app for doing this? I've searched Cydia and scanned the iOS filesystem but haven't found anything obvious.