Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
usually, when a program succeeds, it returns an exit code. success - 0
(zero), any other than zero - failure
you can immediately run scp
to copy. if ssh is not running, the result will be failure
so you can start an endless loop and try to work with the server using ssh
, using scp
until the result is 0
. as soon as you get it 0
, exit the loop - in this case, the files will be downloaded,
you can pause between attempts to connect so as not to hammer the server
Connect:
ssh [email protected]
After entering the command, it will ask for a password. You can also optionally put the -p key if ssh is on some custom port. Accordingly, if connected - everything is ok with SSH.
With csp, everything is simple. 2 examples below:
1. Copy the file "file.txt" from the remote server to the local computer.
2. Copy the file "file.txt" from the local computer to the remote server.
scp file.txt [email protected]:/some/remote/directory
Hello, how to make these arrows fit the bootstrap?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question