Hallo guys,
I am new to Linux, I like to transfer multiple files from server A to server B. Source files URLs (from server A) are in a file called "list.txt"
Eg. in list.txt (these links are selective URLs, not all the files in a directory)
Can be done with e.g. ftp , scp , depending on what your local setup(s) looks like. Search these forums for applications of the e.g. scp command, and scripting for remote hosts.
BTW, the syntax would need to be
user@host:var/www/files/file1.txt
^--- here be colon
Ya, i missed : (colon), i know using scp command for bulk transfer from Server A to Server B, my problem is that there is a huge directory containing lots of files in Source directory say Server A, i have selected the links of those missing files in a text file and want to transfer the files from the file list to server B (Destination)..
Thanks for your reply
Assuming you have ssh-keys setup for password-less login between server A and server B you can use SFTP by creating batch files with the list of files to transfer:-
for file in /var/www/files/file1.txt /var/www/files/file1f.txt /var/www/files/file2g.txt
do
awk ' {
print "put " $0;
}' $file > sftp_batch.cntrl # creating batch file.
sftp -b sftp_batch.cntrl user@server_B # transferring using batch file
done
For a long list of files rdcwayx's proposal will log in remotely again and again, definitely not the most efficient way to do the task. Using list.txt to create a "batch control" file can be done with either scp or sftp...