LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-21-2008, 01:44 PM   #1
kishore_jasthi
LQ Newbie
 
Registered: Feb 2008
Posts: 1

Rep: Reputation: 0
Question How to implement this process


we are doing FTP (one report out put) from one server to another server through shell script program, which is run from oracle application.

Due to the network issues, some times FTP process is hanging.

So we planned to modify the existing program with the following requirements..

1)FTP connection established.
a) one background process should notify(send a mail to user) user if the FTP connection is active after 20 minutes of connection established. After sending a mail this process should be ended.

Even if the FTP is completed within 20 minutes this processes should be closed without notifying (immediately after completion of FTP)

b) Main process will do FTP..
If the FTP is completed unsuccessfully then will notify user with this information....

Please provide me solution for this..

Thx
Kishore
 
Old 02-21-2008, 04:19 PM   #2
rednuht
Member
 
Registered: Aug 2005
Posts: 239
Blog Entries: 1

Rep: Reputation: 31
Code:
#!/bin/bash
# ftpprocess.sh
echo $$ > ftpprocess.lock
ftp <<**
open ftp.site
etc
etc
bye
**
rm ftpprocess.lock
Code:
#!/bin/bash
# ftpwatch.sh
sleep 20m
if [ -f "ftpprocess.lock" ]; then
    echo "ftp process has timed out"
    kill -9 `cat ftpprocess`
fi
Code:
#!/bin/bash
# ftpmaster.sh
sh ftpprocess.sh &
sh ftpwatch.sh
all above code is hand written and untested and may need to be modified to fit your circumstances.

if the process runs often you will have to kill the ftpwatch.sh on sucessful completion of ftppreocess
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
implement pipe using C chrislam Programming 3 09-17-2007 10:33 AM
rsync : how to use and implement indiancosmonaut Solaris / OpenSolaris 8 03-05-2007 12:54 AM
how to implement bridging kaleeshwari Linux - Networking 1 01-22-2007 07:11 AM
About SSH, how to implement this? ICO Linux - Networking 2 04-14-2006 04:52 PM
Shell implement in c SatYr_84 Programming 8 10-06-2005 01:44 AM


All times are GMT -5. The time now is 04:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration