<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: script to login to ftp and check in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/script-to-login-to-ftp-and-check/m-p/3680463#M20770</link>
    <description>You can try as,&lt;BR /&gt;&lt;BR /&gt;ftp -i -n &lt;HOSTNAME&gt; &amp;lt;&amp;lt;-EOF&lt;BR /&gt;user &lt;USERNAME&gt; &lt;PASSWD&gt;&lt;BR /&gt;ls&lt;BR /&gt;mget &lt;FILES&gt;&lt;BR /&gt;!ls&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;You can check script results as echo ${?}  after EOF statement.&lt;BR /&gt;&lt;BR /&gt;hth.&lt;BR /&gt;&lt;/FILES&gt;&lt;/PASSWD&gt;&lt;/USERNAME&gt;&lt;/HOSTNAME&gt;</description>
    <pubDate>Tue, 29 Nov 2005 01:49:15 GMT</pubDate>
    <dc:creator>Muthukumar_5</dc:creator>
    <dc:date>2005-11-29T01:49:15Z</dc:date>
    <item>
      <title>script to login to ftp and check</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-to-login-to-ftp-and-check/m-p/3680462#M20769</link>
      <description>I need the shell script which suppose to check the ftp transation.&lt;BR /&gt;Like the script has to login to the ftp site with corresponding username and password. If ftp have any issues while executing the script, script suppose to throw the message with corresponding issue(eg : problem with port or problem server or etc).&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Yuva</description>
      <pubDate>Tue, 29 Nov 2005 01:45:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-to-login-to-ftp-and-check/m-p/3680462#M20769</guid>
      <dc:creator>yuva_mca</dc:creator>
      <dc:date>2005-11-29T01:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: script to login to ftp and check</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-to-login-to-ftp-and-check/m-p/3680463#M20770</link>
      <description>You can try as,&lt;BR /&gt;&lt;BR /&gt;ftp -i -n &lt;HOSTNAME&gt; &amp;lt;&amp;lt;-EOF&lt;BR /&gt;user &lt;USERNAME&gt; &lt;PASSWD&gt;&lt;BR /&gt;ls&lt;BR /&gt;mget &lt;FILES&gt;&lt;BR /&gt;!ls&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;You can check script results as echo ${?}  after EOF statement.&lt;BR /&gt;&lt;BR /&gt;hth.&lt;BR /&gt;&lt;/FILES&gt;&lt;/PASSWD&gt;&lt;/USERNAME&gt;&lt;/HOSTNAME&gt;</description>
      <pubDate>Tue, 29 Nov 2005 01:49:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-to-login-to-ftp-and-check/m-p/3680463#M20770</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-11-29T01:49:15Z</dc:date>
    </item>
    <item>
      <title>Re: script to login to ftp and check</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-to-login-to-ftp-and-check/m-p/3680464#M20771</link>
      <description>ftp -i -n &lt;HOSTNAME&gt; &amp;lt;&amp;lt;-EOF&lt;BR /&gt;user &lt;USERNAME&gt; &lt;PASSWD&gt;&lt;BR /&gt;ls&lt;BR /&gt;mget &lt;FILES&gt;&lt;BR /&gt;!ls&lt;BR /&gt;EOF 1&amp;gt;/tmp/output.log 2&amp;gt;/tmp/error.log&lt;BR /&gt;if [[ ${?} -eq 0 ]]&lt;BR /&gt;then&lt;BR /&gt;  echo "FTP: Success $(date)"&lt;BR /&gt;else&lt;BR /&gt;  echo "FTP: Failure $(date)"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;You can view /tmp/output.log for STDOUT messages and /tmp/error.log for STDERR informations like problem with port or connectivity problem. &lt;BR /&gt;&lt;BR /&gt;PS: Change the commands you want to execute there.&lt;BR /&gt;&lt;BR /&gt;hth.&lt;/FILES&gt;&lt;/PASSWD&gt;&lt;/USERNAME&gt;&lt;/HOSTNAME&gt;</description>
      <pubDate>Tue, 29 Nov 2005 01:51:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-to-login-to-ftp-and-check/m-p/3680464#M20771</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-11-29T01:51:36Z</dc:date>
    </item>
    <item>
      <title>Re: script to login to ftp and check</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-to-login-to-ftp-and-check/m-p/3680465#M20772</link>
      <description>I think that echo $? wont work to identify if there where a problem with the transacion, for example:&lt;BR /&gt;&lt;BR /&gt;# echo bye |ftp -i localhost   &lt;BR /&gt;ftp: connect: Connection refused                    &lt;BR /&gt;# echo $?                      &lt;BR /&gt;0                                            &lt;BR /&gt;&lt;BR /&gt;You should use the log file created as described above and find for a "transfer ok" message. The message vary depending of the ftp server.&lt;BR /&gt;&lt;BR /&gt;For example, for vsftpd:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;227 Entering Passive Mode (127,0,0,1,75,234)                  &lt;BR /&gt;150 Opening BINARY mode data connection for file (0 bytes).  &lt;BR /&gt;226 File send OK.                                             &lt;BR /&gt;&lt;BR /&gt;So, the verification should be something like:&lt;BR /&gt;&lt;BR /&gt;CORRECT=`grep -w OK $LOGFILE |wc -l`&lt;BR /&gt;&lt;BR /&gt;if [ $CORRECT = 1 ]; then&lt;BR /&gt;  echo "Transfer correct"&lt;BR /&gt;else&lt;BR /&gt; echo "There was a problem with the file transfer, check $LOGFILE"&lt;BR /&gt;fi</description>
      <pubDate>Tue, 29 Nov 2005 02:03:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-to-login-to-ftp-and-check/m-p/3680465#M20772</guid>
      <dc:creator>Ivan Ferreira</dc:creator>
      <dc:date>2005-11-29T02:03:24Z</dc:date>
    </item>
    <item>
      <title>Re: script to login to ftp and check</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-to-login-to-ftp-and-check/m-p/3680466#M20773</link>
      <description>#!/bin/bash&lt;BR /&gt;ftp -i -n 192.0.0.1 &amp;lt;&amp;lt;-EOF&lt;BR /&gt;user anonymous anonymous&lt;BR /&gt;ls&lt;BR /&gt;EOF&lt;BR /&gt; &lt;BR /&gt;This is the script I have used to test. But it is getting hang. so I have killed the process. I hope as per the script it won't take the plain password. Some one please write the script and test it and let me know. It would be great help for me.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Yuva</description>
      <pubDate>Wed, 30 Nov 2005 07:30:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-to-login-to-ftp-and-check/m-p/3680466#M20773</guid>
      <dc:creator>yuva_mca</dc:creator>
      <dc:date>2005-11-30T07:30:24Z</dc:date>
    </item>
    <item>
      <title>Re: script to login to ftp and check</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-to-login-to-ftp-and-check/m-p/3680467#M20774</link>
      <description>You last command should be "bye" to end the ftp transaction.</description>
      <pubDate>Wed, 30 Nov 2005 07:35:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-to-login-to-ftp-and-check/m-p/3680467#M20774</guid>
      <dc:creator>Ivan Ferreira</dc:creator>
      <dc:date>2005-11-30T07:35:31Z</dc:date>
    </item>
    <item>
      <title>Re: script to login to ftp and check</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-to-login-to-ftp-and-check/m-p/3680468#M20775</link>
      <description>#!/bin/bash&lt;BR /&gt;ftp -i -n 192.0.0.1 &amp;lt;&amp;lt;-EOF&lt;BR /&gt;user anonymous anonymous&lt;BR /&gt;ls&lt;BR /&gt;bye&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;I am using the above script. Still it is get hang. Please check your system and let me know.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Yuva&lt;BR /&gt;</description>
      <pubDate>Wed, 30 Nov 2005 08:30:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-to-login-to-ftp-and-check/m-p/3680468#M20775</guid>
      <dc:creator>yuva_mca</dc:creator>
      <dc:date>2005-11-30T08:30:20Z</dc:date>
    </item>
    <item>
      <title>Re: script to login to ftp and check</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-to-login-to-ftp-and-check/m-p/3680469#M20776</link>
      <description>Remove the - in &amp;lt;&amp;lt;-EOF, should be &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;&lt;BR /&gt;Ensure that the last EOF is not indented.&lt;BR /&gt;&lt;BR /&gt;#!/bin/bash&lt;BR /&gt;ftp -i -n 192.0.0.1 &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;user anonymous anonymous&lt;BR /&gt;ls&lt;BR /&gt;bye&lt;BR /&gt;EOF &lt;BR /&gt;</description>
      <pubDate>Wed, 30 Nov 2005 08:34:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-to-login-to-ftp-and-check/m-p/3680469#M20776</guid>
      <dc:creator>Ivan Ferreira</dc:creator>
      <dc:date>2005-11-30T08:34:24Z</dc:date>
    </item>
    <item>
      <title>Re: script to login to ftp and check</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-to-login-to-ftp-and-check/m-p/3680470#M20777</link>
      <description>#!/bin/bash&lt;BR /&gt;ftp&amp;lt;&amp;lt;**&lt;BR /&gt;open 192.1.1.1&lt;BR /&gt;anonymous&lt;BR /&gt;ls&lt;BR /&gt;**&lt;BR /&gt;&lt;BR /&gt;The above script is working. But It is asking the password while executing the script. When I mentioned the password in the script is not taking.It seems we need to give the password at the time of executing the script.&lt;BR /&gt;&lt;BR /&gt;Please check the same and let me know. I donn't want to enter the password manually. we need to mention the password in the script and it suppose to take the password while executing the script. Please suggest the same.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Yuvaraj</description>
      <pubDate>Thu, 01 Dec 2005 04:08:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-to-login-to-ftp-and-check/m-p/3680470#M20777</guid>
      <dc:creator>yuva_mca</dc:creator>
      <dc:date>2005-12-01T04:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: script to login to ftp and check</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-to-login-to-ftp-and-check/m-p/3680471#M20778</link>
      <description>Use like,&lt;BR /&gt;&lt;BR /&gt;ftp -i -n 192.1.1.1&amp;lt;&amp;lt;**&lt;BR /&gt;user anonymous &lt;PASSWD&gt;&lt;BR /&gt;ls&lt;BR /&gt;**&lt;BR /&gt;&lt;BR /&gt;It will take. If you use open then it will prompt for username and password.&lt;BR /&gt;&lt;BR /&gt;Use the ftp script in my prev. threads.&lt;BR /&gt;&lt;BR /&gt;hth.&lt;/PASSWD&gt;</description>
      <pubDate>Thu, 01 Dec 2005 04:37:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-to-login-to-ftp-and-check/m-p/3680471#M20778</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-12-01T04:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: script to login to ftp and check</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-to-login-to-ftp-and-check/m-p/3680472#M20779</link>
      <description>ftp -i -n 192.1.1.1&amp;lt;&amp;lt;**&lt;BR /&gt;user anonymous anonymous&lt;BR /&gt;ls&lt;BR /&gt;**&lt;BR /&gt;&lt;BR /&gt;It is getting hand. Please check and let me know.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Yuva</description>
      <pubDate>Thu, 01 Dec 2005 06:21:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-to-login-to-ftp-and-check/m-p/3680472#M20779</guid>
      <dc:creator>yuva_mca</dc:creator>
      <dc:date>2005-12-01T06:21:19Z</dc:date>
    </item>
  </channel>
</rss>

