rsync sshポートを指定する

rsyncは一般的にはデフォルトでsshを利用するよう設定されているがeオプションで変更することができる。

1

$ rsync -av -e 'ssh -p 10022' ~/path_to_local/files/ user@hostname:~/path_to_remote/files/

eオプションでなく環境変数 RSYNC_RSH に設定しても同じことができる。

You can also choose the remote shell program using the RSYNC_RSH environment variable, which accepts the same range of values as -e.

引用元: rsync

1

2

$ export RSYNC_RSH="ssh -p 10022"

$ rsync -av ~/path_to_local/files/ user@hostname:~/path_to_remote/files/

参考

rsync

Comments