<?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 FTP scripts check remote servers filesize with ftped files in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripts-check-remote-servers-filesize-with-ftped-files/m-p/3953881#M761285</link>
    <description>Hi guys,&lt;BR /&gt;&lt;BR /&gt;I want to ftp the file in linux from windows server. After getting file in linux server i want to check the file size with windows(source) server. If the file size are same with linux then i want to erase the windows file remotely from linux server.&lt;BR /&gt;&lt;BR /&gt;Can you please help me how can i write a&lt;BR /&gt;scripts to check file size with Win server and erase the same. I create a automated FTP scripts but i don't know how to incorporate the same in ftp scripts.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.&lt;BR /&gt;&lt;BR /&gt;Manish</description>
    <pubDate>Thu, 01 Mar 2007 09:47:23 GMT</pubDate>
    <dc:creator>MANISH PATEL_2</dc:creator>
    <dc:date>2007-03-01T09:47:23Z</dc:date>
    <item>
      <title>FTP scripts check remote servers filesize with ftped files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripts-check-remote-servers-filesize-with-ftped-files/m-p/3953881#M761285</link>
      <description>Hi guys,&lt;BR /&gt;&lt;BR /&gt;I want to ftp the file in linux from windows server. After getting file in linux server i want to check the file size with windows(source) server. If the file size are same with linux then i want to erase the windows file remotely from linux server.&lt;BR /&gt;&lt;BR /&gt;Can you please help me how can i write a&lt;BR /&gt;scripts to check file size with Win server and erase the same. I create a automated FTP scripts but i don't know how to incorporate the same in ftp scripts.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.&lt;BR /&gt;&lt;BR /&gt;Manish</description>
      <pubDate>Thu, 01 Mar 2007 09:47:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripts-check-remote-servers-filesize-with-ftped-files/m-p/3953881#M761285</guid>
      <dc:creator>MANISH PATEL_2</dc:creator>
      <dc:date>2007-03-01T09:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: FTP scripts check remote servers filesize with ftped files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripts-check-remote-servers-filesize-with-ftped-files/m-p/3953882#M761286</link>
      <description>Hi Manish:&lt;BR /&gt;&lt;BR /&gt;Checking the size of text files FTP'd between a Unix platform and a Windows platform will always yield a difference!&lt;BR /&gt;&lt;BR /&gt;Unix uses a single character (linefeed) for delimiting newlines.  Windows uses a linefeed *and* a carriage-return to denote the same.  An Ascii mode FTP transfer will add or delete the carriage-return as necessary.&lt;BR /&gt;&lt;BR /&gt;You need to interrogate the status of the FTP transfer.  If successful, then issue a 'delete' command in your FTP session as you wish.&lt;BR /&gt;&lt;BR /&gt;To determine whether or not your FTP commands are successful, you will need to parse the text messages from the session or use Perl.  Checking the exit (return) status of an FTP session is meaningless as it will virtually always appear to have been successful.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 01 Mar 2007 10:01:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripts-check-remote-servers-filesize-with-ftped-files/m-p/3953882#M761286</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-03-01T10:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: FTP scripts check remote servers filesize with ftped files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripts-check-remote-servers-filesize-with-ftped-files/m-p/3953883#M761287</link>
      <description>Hi Manish:&lt;BR /&gt;&lt;BR /&gt;Please see also:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/helptips.do?#28" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/helptips.do?#28&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 01 Mar 2007 10:07:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripts-check-remote-servers-filesize-with-ftped-files/m-p/3953883#M761287</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-03-01T10:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: FTP scripts check remote servers filesize with ftped files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripts-check-remote-servers-filesize-with-ftped-files/m-p/3953884#M761288</link>
      <description>Manish,&lt;BR /&gt;you may be better off using NFS to mount the Windows directory onto the linux box.&lt;BR /&gt;You can then cp the file and check the cp return status.&lt;BR /&gt;if the return status is ok, remove the file from the nfs mount.</description>
      <pubDate>Thu, 01 Mar 2007 10:13:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripts-check-remote-servers-filesize-with-ftped-files/m-p/3953884#M761288</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2007-03-01T10:13:21Z</dc:date>
    </item>
    <item>
      <title>Re: FTP scripts check remote servers filesize with ftped files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripts-check-remote-servers-filesize-with-ftped-files/m-p/3953885#M761289</link>
      <description>Using filesize to verify accuracy is never accurate, especially with Unix systems. Linux, HP-UX, AIX, etc, all have the concept of a sparse file where there may be undefined records. These records are 'filled in' with zeros when they are read serially, even though there were no records and no space occupied. Both files are identical and produce identical results in all ways, but the simple filesize metric will not be the same. Always use a checksum to verify file content.</description>
      <pubDate>Thu, 01 Mar 2007 10:53:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripts-check-remote-servers-filesize-with-ftped-files/m-p/3953885#M761289</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2007-03-01T10:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: FTP scripts check remote servers filesize with ftped files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripts-check-remote-servers-filesize-with-ftped-files/m-p/3953886#M761290</link>
      <description>Hi all&lt;BR /&gt;&lt;BR /&gt;Thanks for your valuable info. Can you please somebody help me how to add check status and delete command in the following shell scripts.&lt;BR /&gt;&lt;BR /&gt;following scripts ftp file from windows to linux and it residing in linux server.&lt;BR /&gt;&lt;BR /&gt;#!/bin/bash                  &lt;BR /&gt;ftp -n -i &lt;IP address=""&gt; &amp;lt;&amp;lt; EOF&lt;BR /&gt;user &lt;USER&gt; &lt;PASSWD&gt;           &lt;BR /&gt;dir                          &lt;BR /&gt;mget *                       &lt;BR /&gt;bye                          &lt;BR /&gt;EOF                          &lt;BR /&gt;exit                         &lt;BR /&gt;&lt;BR /&gt;Thankx&lt;BR /&gt;Manish&lt;/PASSWD&gt;&lt;/USER&gt;&lt;/IP&gt;</description>
      <pubDate>Thu, 01 Mar 2007 11:05:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripts-check-remote-servers-filesize-with-ftped-files/m-p/3953886#M761290</guid>
      <dc:creator>MANISH PATEL_2</dc:creator>
      <dc:date>2007-03-01T11:05:34Z</dc:date>
    </item>
    <item>
      <title>Re: FTP scripts check remote servers filesize with ftped files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripts-check-remote-servers-filesize-with-ftped-files/m-p/3953887#M761291</link>
      <description>Trying to do this within a shell script is very Mickey Mouse because it's difficult to parse ftp's stderr for error messages and you probably won't test everything you need anyway. Use Perl's Net::FTP and this is simple and you get error checking for free.&lt;BR /&gt;&lt;BR /&gt;The attached Perl script returns 0 if ok and non-zero if bad and that's all you need to know to make this work. I will invoke the script one time to get the files in the remote directory and then invoke again for each to get and delete each file. It only deletes the remote file, if the get was ok.&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;typeset remhost="bugs"&lt;BR /&gt;typeset user="cstephen"&lt;BR /&gt;typeset passwd="secret"&lt;BR /&gt;typeset remdir="/tmp/acs" # remote directory&lt;BR /&gt;&lt;BR /&gt;typeset FNAME=""&lt;BR /&gt;typeset -i STAT=0&lt;BR /&gt;&lt;BR /&gt;ftpget.pl -h ${remhost} -l ${user} \&lt;BR /&gt;-p ${passwd} -d ${remdir} -L "" |\&lt;BR /&gt;while read FNAME&lt;BR /&gt;  do&lt;BR /&gt;    echo "Getting ${FNAME}"&lt;BR /&gt;    ftpget.pl -h ${remhost} -l ${user} \&lt;BR /&gt;-p ${passwd} -d ${remdir} -B  -r "${FNAME}"&lt;BR /&gt;    STAT=${?}&lt;BR /&gt;    if [[ ${STAT} -ne 0 ]]&lt;BR /&gt;      then&lt;BR /&gt;        echo "Get of \"${FNAME}\" failed; status ${STAT}." &amp;gt;&amp;amp;2&lt;BR /&gt;        break&lt;BR /&gt;      fi&lt;BR /&gt;  done&lt;BR /&gt;exit ${STAT}&lt;BR /&gt;&lt;BR /&gt;The -B option asserts binary transfers; if you want ASCII use -A. It's important to quote the filename because you might have whitespace embedded in the pathnames --- especially on one of those evil Windows boxes. If you don't want to pass the password then put the username/password tuple in the .netrc file. Invoke as "ftpget.pl -u" for full usage.&lt;BR /&gt;</description>
      <pubDate>Thu, 01 Mar 2007 11:48:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripts-check-remote-servers-filesize-with-ftped-files/m-p/3953887#M761291</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2007-03-01T11:48:15Z</dc:date>
    </item>
    <item>
      <title>Re: FTP scripts check remote servers filesize with ftped files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripts-check-remote-servers-filesize-with-ftped-files/m-p/3953888#M761292</link>
      <description>Hi ACS&lt;BR /&gt;&lt;BR /&gt;Thanks for providing me perl scripts. I tried this scripts in my Linux server but it says "ftpget.pl" command not found. I think i have to installed perl in linux server.&lt;BR /&gt;&lt;BR /&gt;Do you have any idea which commands work (from linux to windows)remotely to get a filenames from windows directory.&lt;BR /&gt;&lt;BR /&gt;Thankx&lt;BR /&gt;Manish</description>
      <pubDate>Fri, 02 Mar 2007 11:37:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripts-check-remote-servers-filesize-with-ftped-files/m-p/3953888#M761292</guid>
      <dc:creator>MANISH PATEL_2</dc:creator>
      <dc:date>2007-03-02T11:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: FTP scripts check remote servers filesize with ftped files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripts-check-remote-servers-filesize-with-ftped-files/m-p/3953889#M761293</link>
      <description>The attachment IS ftpget.pl; install it in some directory such as /usr/local/bin and set the mode to 755. The script that I posted is a shell script which calls the attached ftpget.pl.</description>
      <pubDate>Fri, 02 Mar 2007 11:44:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripts-check-remote-servers-filesize-with-ftped-files/m-p/3953889#M761293</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2007-03-02T11:44:09Z</dc:date>
    </item>
  </channel>
</rss>

