Monday, November 4, 2013

Using SFTP in Shell Script

www.unixbabuforum.inI am using sftp is shell script where I need to get files from A to B. 
Now on A (which is the remote server), I need to calculate the below : 

Number of files transferred, 
Size of each file, 
Count of each file 

The above works when I do it on B but not on A. 

www.unixbabuforum.inYou can modify your script to calculate it, once files get copied in B.( 
suppose in folder /test_sftp in B ) 
Number of files transferred: in server B from A, add ls | wc -l 
Size of each file: du -sh /test_sftp/* 

Can you tell me more on, what you mean by count on each file? 

Share your script and let's see how we can get you to your need. 



Post a Comment

Design by BABU | Dedicated to grandfather | welcome to BABU-UNIX-FORUM