Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Validating the size of file transferred from ftp server to the local system  (Read 3882 times)

0 Members and 1 Guest are viewing this topic.

jpundalik

  • Guest
Validating the size of file transferred from ftp server to the local system

File type: Text file/Flat file
Source System: Windows / Unix Systems
Target System is always: Unix
Mode of Transfer : ASCII

We have generic ftp shell script that transfers the files from different ftp servers.

Some time files are only getting transferred partially & doesn’t show any errors.
An example scenario is given below.
Example Scenario:
Souce System: Unix
Source File’s size: 4000 Kbytes.
Target System: Unix
Target File size: 2000 K bytes.
Reason for the difference in File size: As the target unix system is not having enough space, & the FTP utility doesn’t treat this kind of scenario as an error, the final outcome of the script was successful.

We would like to handle this scenario with the addition of the logic to check the file sizes of the source & target system and decide the final outcome of the script. Please provide your thoughts/suggestions.

Options Tried:
We also tried one of the option that ftp log itself is capturing the file size while transferring. This size is not matching with actual file size got transferred to the local system due to difference in the OS of source and destination