using ssh command
Hi,
How can I use ssh command to get a file automatically from a remote server? The following command is working fine... ssh remote-server "cat /path/to/file" > myfile but here I have to write the output file name again. Here I am facing one problem. If I have to download some files with comman names, example file1,file2,file3...,file10, I give file*, but this will cat all the files into one output file. I want to copy all the files separately into my server along with the time stamp. In general cp -p command do this in the same server. |
There are several approaches. Use scp:
Code:
$ scp "remote-server:/path/to/dir/*" . Code:
$ ssh remote-server "tar -cz *" | tar -xz |
scp -pr remoteserver:<path> <target path> -- to pull files.
scp -pr <path> remoteserver:<remote path> -- to push files. If you have password less authentication for ssh it will copy all files together without prompting for password. If not, it will ask for password, for every file getting copied. |
Its working fine. Unlike ssh the scp -pr is showing the file download percentage. My remote server is password protected. I have kept the multiple scp commands in a shell to download different files, but one problem I am facing is it is asking password for every file to be downloaded. Cont I use a loop to take the password for every different file to be downloaded automatically?
|
Quote:
|
All times are GMT -5. The time now is 05:23 PM. |