I am trying to transfer some file through scp. But it is not working,
scp "vogo_psql_db\:2017-08-30T18\:00\:01.762662" ":db-dump"
ssh: Could not resolve hostname vogo_psql_db\\: Name or service not knownThe problem is I think that due to colons, it is taking vogo_psql_db as hostname even though the escape chars have been used.
What should be done to solve this ?
21 Answer
According to the manual page man scp:
File names may contain a user and host specification to indicate that the
file is to be copied to/from that host. Local file names can be made
explicit using absolute or relative pathnames to avoid scp treating file
names containing ‘:’ as host specifiers. Copies between two remote hosts
are also permitted.So, you can prepend the local filename with an absolute path, or just the simple relative path ./ i.e.
scp "./vogo_psql_db:2017-08-30T18:00:01.762662" ":db-dump"