Search code examples
bashshellunixscp

Shell Script : How to copy list of files from Server 1 to Server 2


I need to copy list of files from Server 1 to Server 2.

I have a variable that he contains a list of selected files in Server 1.

echo "$linesBIV_SIP"

/var/opt/data/flat/88antr/files/CTLRealFSPT/done/PCSCF4C_client_list_20-09-2017-10-00.csv
/var/opt/data/flat/88antr/files/CTLRealFSPT/done/PCSCF5C_client_list_20-09-2017-15-18.csv

I want to copy these selected csv file to Server 2 :

I try :

scp "$linesBIV_SIP" root@hot0017:/opt/application/88antr/test_sh/

I have this error :

/var/opt/data/flat/88antr/files/CTLRealFSPT/done/PCSCF4C_client_list_20-09-2017-10-00.csv
/var/opt/data/flat/88antr/files/CTLRealFSPT/done/PCSCF5C_client_list_20-09-2017-15-18.csv: No such file or directory

I like to try to copy these file in sample command without bash script. Is it possible please ?

Please help. Thank you


Solution

  • I find it : I did like this and it's work fine :

    scp "/var/opt/data/flat/88antr/files/CTLRealFSPT/done/PCSCF4C_client_list_20-09-2017-10-00.csv" "/var/opt/data/flat/88antr/files/CTLRealFSPT/done/PCSCF5C_client_list_20-09-2017-15-18.csv" root@hot0017:/opt/application/88antr/test_sh/
    

    Thanks for all