Wednesday, April 22, 2015

File transfer between two Linux consoles

File transfer between two Linux consoles
--------------------------------------------------------------------------

Description : This will participate at least 2 Linux servers


Step 1 : First logging to the server console that file or directory located
                     
             If you directly logging to server , then provide username and password

             If you logging to server from your developer machine , then use bellow SSH command
                        ssh -l user_name ip_address_of_server_that_located_file
                        ssh -l testuser 169.35.26.45 

Step 2  : Provide password and logging to console

Step 3  : Change directory to file/directory located

              cd /data/backup

Step 4  : List files of given directory and verify your file/directory is available

              ls

              application_backup

Step 5  : Find out IP address, Username, Password and path of the second remote server. This is the location to copy above file or directory.

              IP              : 169.35.26.55
   
              Username : liveuser

              Password  : *******
 
              PATH        : cd /home/uat/backup/


Step 6 : Now copy the file/directory from first server ( 169.35.26.45  ) to second server ( 169.35.26.55 ) using bellow command
             

              scp -r application_backup liveuser@169.35.26.55:/home/uat/backup/


Step 7 : Provide password of second Linux server.



Sample console output from first Linux server





scp -r application_backup liveuser@169.35.26.55:/home/uat/backup/
Password:
application.xml      100% |**********************************************************************************************************|  2646       00:00   
jboss-app.xml        100% |**********************************************************************************************************|    61       00:00   
listClass.tag        100% |**********************************************************************************************************|  2144       00:00   
pagination.tag       100% |**********************************************************************************************************|  4466       00:00   
messageContainer.tag 100% |**********************************************************************************************************|  1880       00:00   
stringSizeClass.tag  100% |**********************************************************************************************************|  1993       00:00   
emailPageContainer.t 100% |**********************************************************************************************************|  6133       00:00   
yearList.tag         100% |**********************************************************************************************************|  6340       00:00   
popupPageContainer.t 100% |**********************************************************************************************************|  2819       00:00   
getMessage.tag       100% |**********************************************************************************************************|  3149       00:00   
pageContainer.tag    100% |**********************************************************************************************************| 14709       00:00