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

Was it helpful?

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top