Quote:
Originally Posted by cfajohnson
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
|
In these situations you run the risk of exhausting the maximum length of arguments to a process. I ran into this problem today when I needed to randomly divide two massive sets of files evenly between two servers. Create a new directory for each server and fill it with symlinks to the files you wish to copy to that server. If it's a lot of files, automate it by creating a script:
Code:
cat file_list | sed 's/^.*$/ln -s & /' > symlink_script.sh