LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-02-2015, 04:52 AM   #1
wh33t
Member
 
Registered: Oct 2003
Location: Canada
Posts: 922

Rep: Reputation: 61
Cool How do I rsync a local dir to a remote dir over ssh with a custom port?


This is what I've got so far and it doesn't appear to be working

Code:
rsync -avz /var/www/html/mywebsite.com.live/current/ "ssh -p 2270" rsyncuser@mywebsite.com:/home/admin/public_html/
This is the response I get.

Code:
ssh: connect to host mywebsite.com port 22: Connection timed out
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(226) [sender=3.1.0]
And just so we're clear, I've setup a password-less login already

Code:
wh33t@ubuntu:~$ ssh -p 2270 rsyncuser@mywebsite.com
Last login: Fri Oct 16 23:31:31 2015 from xxx.xxx.xxx.xxx
rsycnuser@mywebsite.com [~]#
Any tips in the right direction, would be greatly appreciated.
 
Old 12-02-2015, 04:58 AM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Quote:
Originally Posted by wh33t View Post
This is what I've got so far and it doesn't appear to be working

Code:
rsync -avz /var/www/html/mywebsite.com.live/current/ -e "ssh -p 2270" rsyncuser@mywebsite.com:/home/admin/public_html/
This should work.
 
Old 12-02-2015, 05:04 AM   #3
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,876

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
You can also put all the ssh options in a server-specific stanza in ~/.ssh/config and just use the servername in your command.
 
1 members found this post helpful.
Old 12-03-2015, 02:13 AM   #4
wh33t
Member
 
Registered: Oct 2003
Location: Canada
Posts: 922

Original Poster
Rep: Reputation: 61
Quote:
Originally Posted by descendant_command View Post
You can also put all the ssh options in a server-specific stanza in ~/.ssh/config and just use the servername in your command.
Wow, how would I do that? Sorry, super noob here.
 
Old 12-03-2015, 02:17 AM   #5
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,792

Rep: Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306
just google:
http://www.cyberciti.biz/faq/create-...on-linux-unix/
http://nerderati.com/2011/03/17/simp...h-config-file/
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
copying files from home dir to another dir from another dir in a lower dir chomito44 Linux - General 5 10-19-2013 06:18 PM
exclude parameter of rsync- 'dir' vs "dir" vs dir rng Linux - General 5 06-13-2012 01:47 AM
bash script to rsync remote dir with options uopjohnson Linux - General 3 04-23-2010 01:16 AM
rsync -u Does it update the contents of a dir if that dir is changed? crazyivan Linux - Software 1 04-02-2008 03:08 AM
Share configuratin dir (.dir) for 3 accounts on local computer LiNuXkOlOnIe Linux - Software 5 01-08-2006 03:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration