The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 04-23-2007
cfajohnson's Avatar
cfajohnson cfajohnson is offline
Registered User
 

Join Date: Mar 2007
Location: Toronto, Canada
Posts: 659
Quote:
Originally Posted by Sepia
I have two servers. I would like to copy some files from one directory on server A into the same directory on server B.

Its not all the files in in the directory, just some of them.

Is there a way to make a file list in a txt file and then somehow copy all the files in that list in one go to the other server?

What shell are you using? If it's bash or ksh put the list of files in an array, e.g.:

Code:
filelist=( "file 1" "file 2" etc. )

scp "${filelist[@]}" remote.server:path
Or use the list directly on the command line:

Code:
scp "file 1" "file 2" etc. remote.server:path
Reply With Quote