Answer the question
In order to leave comments, you need to log in
How to copy multiple scp files?
Through find I get a list of files from a remote computer via ssh, put them in the $lists variable.
Next, I want to copy them to the local computer.
scp -r -i ~/.ssh/key [email protected]:$lists ~/dir/
copies the first file, gives an error on the following:
cp: cannot stat '/home/files/3.txt': No such file or directory
cp: cannot stat '/home/files/4.txt': No such file or directory
What's wrong, thanks.
Answer the question
In order to leave comments, you need to log in
mkdir /tmp/11
Now all that remains for us on the server from which we are copying is to execute 1 command.
tar cvfz - /home/bitrix/ext_www/site.ru.ru/upload/mail/ |ssh [email protected] "cd /tmp/11;tar xvfz -"
will compress everything into 1 file and stream it to that server by unpacking it
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question