- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to verify FTP Service is running from remote
Operating System - HP-UX
1755655
Members
2505
Online
108837
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-04-2002 10:55 PM
тАО11-04-2002 10:55 PM
How to verify FTP Service is running from remote
Hi all,
I've developed a simple scripts automatically to get a file from a remote machine. The configuration is as follows
machine A (UNIX)
machine B (Windows)
The shell script is residing in A, every one minute (cronjob) will execute the shell script in machine A. In machine B we have install an FTP Server to allow the script in machine A to get the file in machine B.
This thing has works fine so far. But lately there is an issue with the network facilities at our client place, there is no connection between machine A and B.
This script will continue to execute because it has been set as a cronjob. This script contain a line to ftp to the FTP server in machine B.
Because the script will hang waiting the response from machine B FTP Server. While the script is hang, the next cronjob comes in to execute the script and again it hangs. Since this script execute every one minutes, an hour it will execute 60 times ,just imagine a day ! This script will hog the server process. In the end the other program is unable to execute their process.
The script is as below
################
echo "open $IP
user $user $pass
ls
bye" | ftp -nvdi
####################
We can check the line is down by using PING, but how to check if the FTP Server service is down in machine B ?
Rgrds
Mohd Ezree
I've developed a simple scripts automatically to get a file from a remote machine. The configuration is as follows
machine A (UNIX)
machine B (Windows)
The shell script is residing in A, every one minute (cronjob) will execute the shell script in machine A. In machine B we have install an FTP Server to allow the script in machine A to get the file in machine B.
This thing has works fine so far. But lately there is an issue with the network facilities at our client place, there is no connection between machine A and B.
This script will continue to execute because it has been set as a cronjob. This script contain a line to ftp to the FTP server in machine B.
Because the script will hang waiting the response from machine B FTP Server. While the script is hang, the next cronjob comes in to execute the script and again it hangs. Since this script execute every one minutes, an hour it will execute 60 times ,just imagine a day ! This script will hog the server process. In the end the other program is unable to execute their process.
The script is as below
################
echo "open $IP
user $user $pass
ls
bye" | ftp -nvdi
####################
We can check the line is down by using PING, but how to check if the FTP Server service is down in machine B ?
Rgrds
Mohd Ezree
Trial and Error
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-04-2002 11:04 PM
тАО11-04-2002 11:04 PM
Re: How to verify FTP Service is running from remote
Hi Mohd,
I would create a file like ftp_busy in which I would write values like true and false.
At the start of the script, I would check if the value is false. If so, write true in it, and do the rest of the script. If not, exit.
At the end of the script, write false in the script.
This way there will always be just one script running, also in the scenario the ftp connection takes longer than one minute.
Hope this helps
Donald
I would create a file like ftp_busy in which I would write values like true and false.
At the start of the script, I would check if the value is false. If so, write true in it, and do the rest of the script. If not, exit.
At the end of the script, write false in the script.
This way there will always be just one script running, also in the scenario the ftp connection takes longer than one minute.
Hope this helps
Donald
My systems are 100% Murphy Compliant. Guaranteed!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-04-2002 11:25 PM
тАО11-04-2002 11:25 PM
Re: How to verify FTP Service is running from remote
Hi
How many ftp sessions do you have running at any one time if there are no problems ? Do you have other open telnet sessions to that server ?
If you only have the one session to that server you could simply , at the start of your script
# Check if current ftp session open
netstat -an | grep
if [ $? != 0 ]
then
echo "open $IP
user $user $pass
ls
bye" | ftp -nvdi
else
echo "ftp session open" > log
exit
fi
HTH
Steve
How many ftp sessions do you have running at any one time if there are no problems ? Do you have other open telnet sessions to that server ?
If you only have the one session to that server you could simply , at the start of your script
# Check if current ftp session open
netstat -an | grep
if [ $? != 0 ]
then
echo "open $IP
user $user $pass
ls
bye" | ftp -nvdi
else
echo "ftp session open" > log
exit
fi
HTH
Steve
take your time and think things through
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-06-2002 10:56 AM
тАО11-06-2002 10:56 AM
Re: How to verify FTP Service is running from remote
I would probably change the cron script to a self-submitting "at" job instead.
By making it an "at" job, when it takes however long for the ftp command to time-out and return an error it will naturally preclude the starting of the next script and you will have only one running at a time.
in pseudo-script
do ftpstuff
touch a forward-progress file
at now + one minute scriptname
or something like that
You might then also have a cron job that runs once an hour or whatnot that checks on forward progress on the at jobs so you can get a warning if the script dies a horrible death and stops resubmitting itself.
By making it an "at" job, when it takes however long for the ftp command to time-out and return an error it will naturally preclude the starting of the next script and you will have only one running at a time.
in pseudo-script
do ftpstuff
touch a forward-progress file
at now + one minute scriptname
or something like that
You might then also have a cron job that runs once an hour or whatnot that checks on forward progress on the at jobs so you can get a warning if the script dies a horrible death and stops resubmitting itself.
there is no rest for the wicked yet the virtuous have no pillows
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP