Question

scp root@foo.net:/var/www/html/sites/foo.sql /Users/foo/Desktop/folder1

How can I copy multiple sql files over in one command?

If I have foo.sql; foo_1.sql; foo_2.sql

Était-ce utile?

La solution

Try doing it this way , The one line below should run scp multiple times .

  scp root@foo.net:/var/www/html/sites/foo.sql 
  scp root@foo.net:/var/www/html/sites/foo_1.sql
  scp root@foo.net:/var/www/html/sites/foo_2.sql

And execute the following line.(file1,2,3 in the below command should be the abslout path to the files)

 for REMOTE in "/Users/foo/Desktop/folder1" ; do scp file1 file2  file 3 $REMOTE; done

I hope you find this useful.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top