How to use rsync with a different port?


#1

Hi,
i am trying to figure out how to backup my box with rsync but with a different port.
i have tried to modify the backup.py[1], but that gives me this error when setting up rsync in the web interface:


I changed in line 19 [2] “-p 22” to “-p 2222”.

Any ideas on how to get it working?
Thanks for your time!

[1] https://github.com/mail-in-a-box/mailinabox/blob/a081d040822ce0f58e0554b6a28e36945cde0275/management/backup.py
[2] “–rsync-options=-e “/usr/bin/ssh -oStrictHostKeyChecking=no -oBatchMode=yes -p 22 -i /root/.ssh/id_rsa_miab””,


#2

This question has been asked but never answered. … see this thread for my solution to the problem which may or may not be practical for you.


#3

Thank you for your answer!
I am already doing it like this. :slight_smile:
Maybe this should be more a feature request than a maintenance question. I think it choosing a port for the rsync backup can be useful for a lot of people who want to backup their Mail-in-a-Box to a home computer.


#4

You can push the rsync output to your NAS easily. I am using at home the WD My Cloud Ex2 NAS and the SSH is listening on a different port than the 22. So AFTER opening the 2233 port at the firewall of my router, I’m doing this:

rsync -a -e “ssh -p 2233” /home/user-data/backups/encrypted/ root@xxx.xxx.xxx.xxx:/path/where/to/backup

Don’t forget the encryption key!

You may need to delete the local backup though after the transfer, but this might be a good example for a different cronjob entry.


#5

hello,

i don’t know if this helps but you could just create a ssh config file for the root user on your miab.

/root/.ssh/config

Host hostnameof.your.bkpserver
    Port 2345

this way the rsync job will automatically use the desired port (no need to hack scripts).


#6

Hello everyone
How can i use resync back up ?
tell me .
best regards
stevesmith
Writer at best dissertation help in UK.


#7

This is the perfect way that will make us able to have best solutions from dissertation writing services, using this specified port.


#8

Hello everyone
How can I use resync back up?
tell me.
Best regards
Cyberops
Best institute for cyber security course and VAPT in India.