LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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-20-2004, 10:48 AM   #1
ohcarol
Member
 
Registered: Dec 2004
Location: Nepal
Posts: 86

Rep: Reputation: 15
backing up remote folder with rsync and ssh


hi

I want to backup my data from remote machine using rsync and ssh. Can anyone tell me how to do that? My ssh uses port 2002. What are the process for backing up data using rsync with ssh?

Local machine ip: 192.168.2.1
Remote machine ip: 192.168.2.25
both machine uses ssh port 2001
 
Old 12-20-2004, 12:49 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Take a look at this LA:
http://www.linuxquestions.org/questi...ticle&artid=80
 
Old 12-21-2004, 10:42 AM   #3
ohcarol
Member
 
Registered: Dec 2004
Location: Nepal
Posts: 86

Original Poster
Rep: Reputation: 15
rsync and ssh port

Hello

I want to backup some files from remote machine with rsync and ssh, but my ssh uses different port ie 2002. Could you please help me with the rsync command for specifying command. for eg.

$ rsync -avr -e ssh thitto@192.168.0.1:2001/home/thitto/ /dstdir/


Is this correct?
 
Old 12-22-2004, 01:57 PM   #4
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
I haven't actually tried that with rsync but I think you need to specify the port in the -e option:
-e "ssh -p 1234"

Assuming the server is on port 1234
 
Old 12-27-2004, 04:05 AM   #5
ohcarol
Member
 
Registered: Dec 2004
Location: Nepal
Posts: 86

Original Poster
Rep: Reputation: 15
rsync and ssh port

Thank david_ross it worked. Another thing I want to ask is how can I specify ssh password in scripts so that it will automatically execute via cron at midnight.

#!/bin/bash

/usr/bin/rsync -avr -e "ssh -p1234" root@abc.domain.com:/home/root/mail \

/home/root/backup/

password
 
Old 12-28-2004, 08:39 AM   #6
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Rather than leaving passwords in plain text files and having to remember to change them after a period of time I would reccomend using public key authentication - see:
http://www.linuxquestions.org/questions/answers/79
 
Old 01-03-2005, 12:43 AM   #7
mtkeira
LQ Newbie
 
Registered: Jan 2005
Location: Wollongong, Australia
Distribution: SUSE 9.1
Posts: 10

Rep: Reputation: 0
Alternatives to unison and rsync?

Has anyone come across anything more sophisticated that unison or rsync? I'd been using a freeware tool called SyncBack (http://www.2brightsparks.com/syncback/syncback-hub.html) under Windows to backup and mirror files between a laptop and PC over a simple peer network. I'm looking for something similar or to achieve the same result.

For example, in one instance I only sync new or modified files from the last 90 days and on the PC they are zipped to save space (but they remain unzipped on the laptop).

Thanks, James
 
  


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
Folder Max Size and Limiting SSH access to home folder. Mefistofeles Linux - General 4 11-26-2005 02:09 PM
rsync and backing up danimalz Linux - Software 12 10-24-2005 12:01 PM
RSync or another way? Backing Up Off-site. kemplej Linux - Software 0 08-19-2004 04:55 PM
Backing up remote Linux Server to Local Win2KPro CD-RW over SSH McK66 Linux - General 3 06-08-2004 09:05 PM
Backing-up a folder esael Slackware 1 09-15-2002 11:09 PM

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

All times are GMT -5. The time now is 08:00 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