<?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 retry process in ftp script...!!!! in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/retry-process-in-ftp-script/m-p/3910660#M284450</link>
    <description>hi #!/bin/bash&lt;BR /&gt;SERVER=10.89.40.35&lt;BR /&gt;USER=xyz&lt;BR /&gt;PASSWD=xyz&lt;BR /&gt;&lt;BR /&gt;ftp -in $SERVER&amp;lt;&lt;EOF&gt;&lt;/EOF&gt;user $USER $PASSWD&lt;BR /&gt;mkdir PPL&lt;BR /&gt;cd /path of remote dir&lt;BR /&gt;lcd /path of local dir&lt;BR /&gt;hash&lt;BR /&gt;bin&lt;BR /&gt;put &lt;FILE name=""&gt;&lt;BR /&gt;bye&lt;BR /&gt;&amp;lt;&lt;EOF&gt;&lt;/EOF&gt;&lt;BR /&gt;The above ftp script i have to schedule in crontab at a particular instance of time run daily.&lt;BR /&gt;In the above ftp script i have to implement a retry process.&lt;BR /&gt;So that in the case if the transfer is stopped in between ftp for any reasons then after a gap of 15 mins the ftp session again retry to do the ftp.&lt;BR /&gt;&lt;BR /&gt;This is done so that the person at remote server where the files are to be dumped get an idea that some problem lies in connectivity if ftp fails..after a no. of retries .&lt;BR /&gt;&lt;BR /&gt;PLS if anybody cld help in writin the code for it..&lt;/FILE&gt;</description>
    <pubDate>Mon, 11 Dec 2006 03:52:11 GMT</pubDate>
    <dc:creator>rookie250</dc:creator>
    <dc:date>2006-12-11T03:52:11Z</dc:date>
    <item>
      <title>retry process in ftp script...!!!!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/retry-process-in-ftp-script/m-p/3910660#M284450</link>
      <description>hi #!/bin/bash&lt;BR /&gt;SERVER=10.89.40.35&lt;BR /&gt;USER=xyz&lt;BR /&gt;PASSWD=xyz&lt;BR /&gt;&lt;BR /&gt;ftp -in $SERVER&amp;lt;&lt;EOF&gt;&lt;/EOF&gt;user $USER $PASSWD&lt;BR /&gt;mkdir PPL&lt;BR /&gt;cd /path of remote dir&lt;BR /&gt;lcd /path of local dir&lt;BR /&gt;hash&lt;BR /&gt;bin&lt;BR /&gt;put &lt;FILE name=""&gt;&lt;BR /&gt;bye&lt;BR /&gt;&amp;lt;&lt;EOF&gt;&lt;/EOF&gt;&lt;BR /&gt;The above ftp script i have to schedule in crontab at a particular instance of time run daily.&lt;BR /&gt;In the above ftp script i have to implement a retry process.&lt;BR /&gt;So that in the case if the transfer is stopped in between ftp for any reasons then after a gap of 15 mins the ftp session again retry to do the ftp.&lt;BR /&gt;&lt;BR /&gt;This is done so that the person at remote server where the files are to be dumped get an idea that some problem lies in connectivity if ftp fails..after a no. of retries .&lt;BR /&gt;&lt;BR /&gt;PLS if anybody cld help in writin the code for it..&lt;/FILE&gt;</description>
      <pubDate>Mon, 11 Dec 2006 03:52:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/retry-process-in-ftp-script/m-p/3910660#M284450</guid>
      <dc:creator>rookie250</dc:creator>
      <dc:date>2006-12-11T03:52:11Z</dc:date>
    </item>
    <item>
      <title>Re: retry process in ftp script...!!!!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/retry-process-in-ftp-script/m-p/3910661#M284451</link>
      <description>Hi,&lt;BR /&gt;a couple of ideas:&lt;BR /&gt;1. you can check the return status of your ftp command and then rerun your ftp script&lt;BR /&gt;ftp&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;status=$?&lt;BR /&gt;&lt;BR /&gt;2. you can check logfile for errors&lt;BR /&gt;ftp -in $SERVER &amp;lt;&amp;lt; EOF &amp;gt; logile&lt;BR /&gt;&lt;BR /&gt;3. you can compare filesizes after completion of ftp&lt;BR /&gt;&lt;BR /&gt;4. We write put a start file at the beginning of the ftp script, then the datafile and finally we put a end file.&lt;BR /&gt;&lt;BR /&gt;This way the receiver knows when the transfer started and that the datafile is complete, as we only transfer the end file after completing the data transfer.&lt;BR /&gt;&lt;BR /&gt;Please also read:&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/helptips.do?#33" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/helptips.do?#33&lt;/A&gt; on how to reward any useful answers given to your questions.&lt;BR /&gt;&lt;BR /&gt;So far you have not awarded any points !&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 11 Dec 2006 04:04:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/retry-process-in-ftp-script/m-p/3910661#M284451</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2006-12-11T04:04:51Z</dc:date>
    </item>
    <item>
      <title>Re: retry process in ftp script...!!!!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/retry-process-in-ftp-script/m-p/3910662#M284452</link>
      <description>The return code from ftp only refers to the ability to connect to the server -- nothing else. The reason is obvious: you can issue dozens of different commands (cd, dir, put, get, etc) and any of them could fail...so which command should affect the return code? So you must use ftp with a separate check, after the primary ftp process runs. You can reconnect with ftp and use dir to verify that the file exists and is the correct size. Note that you'll have to extract the dir line from stdout.</description>
      <pubDate>Mon, 11 Dec 2006 08:31:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/retry-process-in-ftp-script/m-p/3910662#M284452</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2006-12-11T08:31:29Z</dc:date>
    </item>
    <item>
      <title>Re: retry process in ftp script...!!!!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/retry-process-in-ftp-script/m-p/3910663#M284453</link>
      <description>This is one of the reasons why you should use Perl's Net::FTP module. It does error checking for free. The attached Perl script will put a file for you and do optional automatic retries on failure. Invoke as ftpput.pl -u for full usage but to do the task you listed above with 5 retries then:&lt;BR /&gt;&lt;BR /&gt;ftpput.pl -h ${SERVER} -l ${USER} -p ${PASSWD} \&lt;BR /&gt;-B -d /remote_dir -t 5 file1 file2 file2&lt;BR /&gt;STAT=${?}&lt;BR /&gt;if [[ ${STAT} -ne 0 ]]&lt;BR /&gt;  then&lt;BR /&gt;    echo "ftpput failed. status ${STAT}." &amp;gt;&amp;amp;2&lt;BR /&gt;  fi&lt;BR /&gt;&lt;BR /&gt;and if any operation such as cd fails a non-zero exist status will be returned to the shell.&lt;BR /&gt;</description>
      <pubDate>Mon, 11 Dec 2006 10:44:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/retry-process-in-ftp-script/m-p/3910663#M284453</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-12-11T10:44:19Z</dc:date>
    </item>
    <item>
      <title>Re: retry process in ftp script...!!!!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/retry-process-in-ftp-script/m-p/3910664#M284454</link>
      <description>I use LFTP (&lt;A href="http://lftp.yar.ru/)" target="_blank"&gt;http://lftp.yar.ru/)&lt;/A&gt; for a similar purpose.  It returns better exit codes than the native ftp program.</description>
      <pubDate>Tue, 12 Dec 2006 08:43:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/retry-process-in-ftp-script/m-p/3910664#M284454</guid>
      <dc:creator>Robert Herron</dc:creator>
      <dc:date>2006-12-12T08:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: retry process in ftp script...!!!!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/retry-process-in-ftp-script/m-p/3910665#M284455</link>
      <description>Hi, &lt;BR /&gt;&lt;BR /&gt;I have a ftp script which will take input from a parameter file and will transfer file. You can add some condition for exit code checking and rerun the loop / function..&lt;BR /&gt;&lt;BR /&gt;May be helpful to you..&lt;BR /&gt;---------------------------------------------&lt;BR /&gt; while read dest_ip dest_user dest_pwd dest_file&lt;BR /&gt; do&lt;BR /&gt;     if [[ -f $dest_file ]]&lt;BR /&gt;     then&lt;BR /&gt;       echo "Transferring $dest_file file."&lt;BR /&gt;       {&lt;BR /&gt;       echo open $dest_ip&lt;BR /&gt;       echo user $dest_user $dest_pwd&lt;BR /&gt;       echo put $dest_file $dest_file &lt;BR /&gt;       echo close&lt;BR /&gt;       } | ftp -inv&lt;BR /&gt;       check=$?&lt;BR /&gt;       echo "$dest_file file transfer complete."&lt;BR /&gt;     fi&lt;BR /&gt; done &amp;lt; mapfile&lt;BR /&gt;---------------------------------------------&lt;BR /&gt;the mapfile contains entries like below.&lt;BR /&gt;&lt;BR /&gt;Destnation_Svr_Name/IP  ftp_usr_name passwd file_2transfer&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 12 Dec 2006 11:45:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/retry-process-in-ftp-script/m-p/3910665#M284455</guid>
      <dc:creator>J Prafull</dc:creator>
      <dc:date>2006-12-12T11:45:12Z</dc:date>
    </item>
  </channel>
</rss>

