Results 1 to 13 of 13
Thread: setting up rsync :)
-
11-25-2004, 09:00 PM #1Junior Guru
- Join Date
- May 2004
- Posts
- 193
setting up rsync :)
First of all, yes i used search didnt help me much there
What i want to do in the end:
copy /backup/cpbackup/daily to a remote server in the same directory. I have used google alot and used search here but still i didnt succeed.
I found this nice tutorial here:
http://servers.linux.com/article.pl?...d=47&pagenum=1
It really works well and its easy...i come to the part where i can ssh ro the remote host without password entering...but when i do the test below it:
rsync -avz -e "ssh -i ~/rsync-key" /some/small/directory/ remote_user@remotehost.com:/backup/destination/directory/
It asks me for a password again..
when i just do ssh remote_user@remotehost.com i get in without a password...
I did everything according to the above (yes i even changed remote_user to the correct user and remote host the remote host... )....still it doesnt work..keeps asking for a password.
Does anyone know to get passed this? I am quite clueless here, and dont know really what to do..never used rsync personally before
Thank you in advance,
haris.
-
11-25-2004, 09:05 PM #2Web Hosting Master
- Join Date
- May 2001
- Location
- Montreal, Quebec
- Posts
- 589
If you can connect through SSH without passwords, it means that your key is already in your home directory under the ".ssh" directory.
In that case, just remove the "-i ~/rsync-key" from your command line and it should work.
-
11-26-2004, 02:54 AM #3Junior Guru
- Join Date
- May 2004
- Posts
- 193
tried it ..doesnt work
-
11-26-2004, 03:03 AM #4Web Hosting Master
- Join Date
- May 2001
- Location
- HK
- Posts
- 3,082
You may have a module in /etc/rsyncd.conf on your backup server so that you can push the data to there without password prompt ~
-
11-26-2004, 03:05 AM #5Junior Guru
- Join Date
- May 2004
- Posts
- 193
thanks, ill check it!
-
11-26-2004, 03:16 AM #6Web Hosting Master
- Join Date
- May 2001
- Location
- HK
- Posts
- 3,082
Actually I recommend you use your backup server to pull the data rather than using your main server to push the data to your backup server ~
Because if you push the data to it, anyone on your server can push things to there because on your backup server, you are allowing that server to push things to it ~~
If you pull things to it, only your backup server can gets and save your data ~
Assume 123.123.123.123 is your backup server IP
and 234.234.234.234 is your main server IP
To do this, simply add this in /etc/rsyncd.conf in your server (NOT the backup server)
[my_backup]
comment = my backup
uid = root
gid = root
read only = yes
path = /backup/cpbackup/daily
hosts allow = 123.123.123.123
stop rsync and and start it again and specify the config file ~
stop rsync and do:
rsync --daemon --config=/etc/rsyncd.conf
Now on your backup server, simply run:
/usr/bin/rsync -avz 234.234.234.234::my_backup/ /path/to/store/on/backup/server
That would make the backup server to pull the data in your /backup/cpbackup/daily (specified in rsyncd.conf) from your main server and store it in /path/to/store/on/backup/server
Let me know if it works ~~Last edited by YUPAPA; 11-26-2004 at 03:25 AM.
-
11-26-2004, 03:44 AM #7WHT Addict
- Join Date
- Aug 2004
- Location
- NY
- Posts
- 100
Why dont you use www.rsnapshots.org readymade rsync rpm utility.
It is easier to use.
-
11-26-2004, 12:15 PM #8Junior Guru
- Join Date
- May 2004
- Posts
- 193
Originally posted by mali
Why dont you use www.rsnapshots.org readymade rsync rpm utility.
It is easier to use.
this site dont work
-
11-26-2004, 06:24 PM #9Retired Moderator
- Join Date
- May 2004
- Location
- Toronto, Canada
- Posts
- 5,105
bumpage.. what is that site he is referring to ? Doesnt work for me either.
CloudNexus Technology Services
Managed Services
-
11-26-2004, 06:52 PM #10Newbie
- Join Date
- Nov 2004
- Posts
- 20
This is what I use, and it works well:
(with your locations inserted)
rsync -carlpogte ssh /backup/cpbackup/daily $REMOTESERVER:/backup/cpbackup/
or if you would like to delete files at the destination that have been deleted at the source:
rsync -carlpogte ssh --delete /backup/cpbackup/daily $REMOTESERVER:/backup/cpbackup/
As you can see, this goes over SSH, so you don't have to run rsyncd.
Make sure your SSH key authentication is working correctly.Last edited by naidd; 11-26-2004 at 06:56 PM.
-
11-27-2004, 04:40 PM #11Junior Guru
- Join Date
- May 2004
- Posts
- 193
ahh ok its
http://www.rsnapshot.org/
-
11-27-2004, 04:48 PM #12Junior Guru
- Join Date
- May 2004
- Posts
- 193
Q: Can I set the snapshot_root to a remote SSH path? I want to push my backups to a remote server, rather than pull them from a remote server.
A: Currently this is not possible. This would be a nice feature, but several questions remain unanswered:
How can the integrity of the snapshot root be guaranteed if one or more remote servers have write access to it?
When snapshots are rotated, which of the potentially several remote servers connecting is responsible for performing this task?
One possibility is to have a "staging" area for files to be transferred to, then have rsnapshot sync from this staging area into the snapshot root. Can this be accomplished without taking up double the disk space?
Does this mean i cannot push the backups to a remote server, but i CAN pull them from the originating server to the remote server?
-
11-27-2004, 05:41 PM #13Retired Moderator
- Join Date
- May 2004
- Location
- Toronto, Canada
- Posts
- 5,105
thanks ley..