Problem with SFTP...

Hi,

Here is my problem::confused:

Daily my ETL process will create 4 (Four) Flatfiles in unix box. Upon creation of the flatfiles, I need to do "SFTP" the files to a "Remote Server".

Sometimes While doing SFTP, the files get trucated due to it's size.

Now I would like to design a Korn shell script to verify whether those 4 files has successfully "SFTP'ed" to the destination Server or not?

Could you please provide me the logic for "KShell script" for the above functionality? Your help will be appreciated.

Thanks!
Praveen

Hi Praveen..
First find the number of files & their size. assign the values to an array.
And after sending files, create another array with number of files sent and their size. Finally compare both arrays.

plz update your results..

I am not familiar with array concept in Unix scripting. Would it be possible to you to provide me the code for it? Your help will be highly appreciated!

1) take the size of the files in local host
2) take the size of file after sftp from remote host
ssh -n remote_host ls -ltr file | awk '{print$5}'
##This will give you the size of sftped file from remote host
3) compare the size of the file to make sure it transfered successfully ..