Capture at job number upon submission
I've got a shell script that submits a subjob to atd. This subjob could potentially take a long time. If it is taking more than 15 minutes, the script moves on and performs the action in another (less desirable) way and the at job should be cancelled or killed. Is there a way to capture the at job number that is submitted? If for some reason the atd daemon is down or hung, I want to be able to remove the at job I submitted.
If I can capture this job number, I can be assured I atrm the right job number. There are obviously other work arounds, but it is much clearer if I could just capture this job number during submission.