0

I have a cluster with 4 machines. One of them is cluster manager. When cluster manager start a backup, each slave cluster creates cluster backup files in it's own file system.

After cluster manager finished backup process, I have to copy cluster backups from each slave cluster to another remote storage machine. Slave clusters and storage machine ssh ports are different.

I'm thinking copy files from remote clusters to remote storage machine by secure copy over cluster manager, like:

scp cluster1.com:/backup/files storage.com:/backup/cluster1 
scp cluster2.com:/backup/files storage.com:/backup/cluster2 
scp cluster3.com:/backup/files storage.com:/backup/cluster3 
...

As I said ssh port of the clusters and storage machines are different. But scp command has only one port keyword argument. Is there a way to set both cluster and storage server ports with scp command?

1 Answer 1

1

Use ssh_config, which allows you to create aliases for hosts used in scp and specify separate ports. In short fill in your ~/.ssh/config or /etc/ssh/ssh_config:

Host host1
  Hostname host
  Port 2222
Host host2
  Hostname host
  Port 2223

and then you can simply use

scp host1:/backup/files host2:/backup/cluster1

You can store also other information in the config, such as users, identity files and so on.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .