General discussion

Locked

Make my shell script die when finished.

By JeffreyMangan ·
I have a shell script that FTPs files from HP-UX to a Novell server every 5 minutes as an upload. Sometimes the previous upload script hangs out there so the subsequent uploads won't run because they grep for the script and see it still out there. How can I make a script die better when it's finished. Sometimes these hang for 2 hours or until I kill the PID for the script then in 5 minutes the next upload can run.

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Make my shell script die when finished.

by cpfeiffe In reply to Make my shell script die ...

I assume you are using .netrc to automate the ftp process. If not you should read up on it, it might be a better way to handle the ftp portion of your job. Either way, make sure `bye` is the last command you issue in .netrc. If you are already doing this then put in the line command `exit 0` at the end of your script. If you are going to start doing this though, you may want to put in some testing within your script to make sure certain parts of it complete maybe with a case or an if statement and issue different exits throughout ths script. Browsing some of the startup scripts for structure and syntax is a good way to get started. If you'd like step by step on .netrc email my alias and I'll post it.

Collapse -

Make my shell script die when finished.

by JeffreyMangan In reply to Make my shell script die ...

Poster rated this answer

Collapse -

Make my shell script die when finished.

by JeffreyMangan In reply to Make my shell script die ...

This question was closed by the author

Back to Linux Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums