Hi friends,
I'm beginning to learn to write simple shell scripts. It's not as bad a learning experience as I thought.
I am a bit stuck with one of my scripts right now, and I am hoping that someone will suggest the right thing.
This is a fairly newbie question.
I have a
java program that generates a file.
This file has to be uploaded to a server via ftp.
I have written two shell scripts, one to run the java program and the other to upload the file. I am calling them in crontab so that they are executed everyday at a specific time with a difference of half an hour. Although this is working, this is not very good as the file upload script is being called after half an hour. If for some reason my java program takes more than half an hour for execution the file upload scipt will upload incomplete file, or if my program finishes in 5 minutes file upload will wait unnecessarily for 25 minutes.
What I would like to do is call this file upload script as soon as the java program finishes its execution. So what should I be doing, catch the exit code of the java program and call the file upload script?
I would appreciate any suggestions.
Thanks,
Cnu