How to use Rsync?
I have a file pluto.sh on each machine(ubuntu Fiesty and Fedora 7).
Everytime developer update the file with codes to Fedora 7 machine.All I want is to rync it to Ubuntu Fiesty. How can it be possible with rsync? |
Code:
rsync -avz file_name user@host:/path_to_store |
I tested it manually in this way:
I created a folder called pit under /opt on ubuntu machine. Under that I create a file called kally. I edited kally and wrote: Code:
How are you ? Now On Ubuntu I ran the command: Code:
Code:
building file list ... done Correct me if I am wrong at the steps |
are you trying to sync both ways from what you have shown below it looks like you ran the command.
Code:
rsync -avz vjs@fedora7:/opt/pit kally Code:
rsync -avz kally vjs@fedora7:/opt/pit the general principal with rsync is Code:
rsync -options <source> <destination> |
I am confused !!!
Lets make it more clear, I have Ubuntu and Fedora Machine. On Ubuntu I have file at /opt/linux and on fedora I have same file as /opt/linux. I went to ubuntu machine: And edited Code:
#echo "hello" > linux |
Its Working fine now.
I was mistaken at running command and now its working. How can I proceed with ssh without providing password. I followed http://troy.jdmz.net/rsync/index.html link but again it is asking for password. Any idea why its behaving so? I read the troubleshooting colum too but that dint help. Pls Help |
New issue => new thread
|
if I am not wrong RSYNC with SSH do come under "How to RSync"
I could have asked for number of Questions related to RSYNC at single shot but I need to understand if I am wrong at my steps.Now as I am having rsync working I need a script for rsync without password. So i dont think that would make any difference following up till my rsync gets working to the fullest. Hope you will understand. |
For password-less ssh log ins you must first create your ssh key for your local machine:
Code:
ssh-keygen -t rsa Then upload the contents of the file /home/*user*/.ssh/id_rsa.pub to the file /home/*user*/.ssh/authorized_keys on the remote host (or /root/.ssh/authorized_keys for root log in) Debian distros come with a nice tool to upload the key to the remote host: Code:
ssh-copy-id -i ~/.ssh/id_rsa.pub username@remotehost Code:
rsync -av --delete-before --stats --progress --rsh='ssh -c arcfour -p22' root@10.36.39.1:/ /home/storage/BackUp/ --exclude="/proc/" --exclude="/lost+found/" --exclude="/mnt/" --exclude="/dev/" Please be very careful with the "--delete-before" option. If you get mixed up, it can delete your whole hard drive. Before using --delete-before, run rsync with the -n option for a dry run that won't modify or transfer anything so you can see what will happen. man rsync: http://www.manpagez.com/man/1/rsync/ |
edit: previous poster beat me to the punch, with similar instructions - no need to muddy the waters.
cheers, |
I'm interested in this topic too. However, my question is how to set this up so that rsync doesn't don't need to log in as root to do the backup.
(BTW, I'm actually using dervish, which uses rsync.) I made /root/.ssh/authorize_keys and I have it working, but now I want to get the backup working without the root login. Thanks for any help. |
Quote:
Of course you would also have to add your id_rsa.pub key to /home/someuser/.ssh/authorize_keys And of course if you don't log in as root, you might not be able to get access to some files... |
All times are GMT -5. The time now is 05:15 PM. |