I recently set up BackupPC to back up a remote server using rsync over ssh. I won't go into the gory details now, but in order to make it work on an alternate port, I had to make the following change to the config file for this host:

view plain print about
1$Conf{RsyncClientCmd} = '$sshPath -p 1234 -q -x -l root $host rsync $argList+';

This will connect to ssh running on port 1234 on the remote $host.

If you try changing $sshPath to include the switch, BackupPC tries to escape the arguments when using them, and that results in weird errors.