[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1466
  • Last Modified:

RSYNC over a different port

I am currently running the following command BUT I want to be able to specify a different port. For example: 'ssh -p 3333' I cannot figure out the correct syntax to implement it.

#!/bin/bash
OPTIONS="-Cavz --delete --backup"
BACKUPDIR="/backup/incrementals/`date +%d-%m-%y--%a`"
rsync $OPTIONS --backup-dir=$BACKUPDIR root@xxx.xxx.xxx.xxx:'/archive' /backup
chown -R root:root /backup
chmod -R 0777 /backup
0
the_omnific
Asked:
the_omnific
  • 2
  • 2
1 Solution
 
svsCommented:
You can set the port in ~/.ssh/config
0
 
the_omnificAuthor Commented:
I know, but it is essential that I specify a port within the command.

Thanks
0
 
svsCommented:
Apparently, the syntax is:

rsync -e 'ssh -p 3333' ...
0
 
the_omnificAuthor Commented:
#!/bin/bash
OPTIONS="-Cavz --delete --backup"
BACKUPDIR="/backup/incrementals/`date +%d-%m-%y--%a`"
rsync -e 'ssh -p 3333' $OPTIONS --backup-dir=$BACKUPDIR root@xxx.xxx.xxx.xxx:'/archive' /backup
chown -R root:root /backup
chmod -R 0777 /backup

I should guessed.....

Thanks
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now