[opensuse] rsync syntax
Hi All, I need to start synchronizing a 'live' website, nightly, with the 'master' copy residing under ~/public_html/ on my local box. I have user account level ssh access to the server and, when I log in, it 'lands' me at /home/user/ ('~/'), directly above the 'live' website directory at ~/public_html/ (is symlinked to ~/www/). I'm sure there are many people on this list who know how to do this. I *sort of* know since I use rsync locally on a daily basis. However, the 'live' site lives on a production box and just don't feel like experimenting. :-) Any recommendations/advice on the correct syntax to use with rsync? TIA & regards, Carl -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
I need to start synchronizing a 'live' website, nightly, with the 'master' copy residing under ~/public_html/ on my local box.
I have user account level ssh access to the server and, when I log in, it 'lands' me at /home/user/ ('~/'), directly above the 'live' website directory at ~/public_html/ (is symlinked to ~/www/).
I'm sure there are many people on this list who know how to do this. I *sort of* know since I use rsync locally on a daily basis. However, the 'live' site lives on a production box and just don't feel like experimenting. :-) Any recommendations/advice on the correct syntax to use with rsync?
What, care to read its manpage? -PHSav is a good thing, the rest is up to you! cron is your friend, and pay attention to rsync directory syntax (you want `rsync -PHSav ~/public_stuff/ master:~/www/`, with trailing slashes) -`J' -- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sunday 24 December 2006 15:53, Jan Engelhardt wrote:
What, care to read its manpage?
I have, but you know how cryptically they're written!
-PHSav is a good thing, the rest is up to you! cron is your friend, and pay attention to rsync directory syntax (you want `rsync -PHSav ~/public_stuff/ master:~/www/`, with trailing slashes)
I'm okay with the flags and slashes part, already. How do I pass it the remote username, host IP/domain and pw to have it open an ssh2 connection? Thanks! Carl -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sunday 24 December 2006 15:53, Jan Engelhardt wrote:
What, care to read its manpage?
I have, but you know how cryptically they're written!
Can't be worse than pure EBNF.
-PHSav is a good thing, the rest is up to you! cron is your friend, and pay attention to rsync directory syntax (you want `rsync -PHSav ~/public_stuff/ master:~/www/`, with trailing slashes)
I'm okay with the flags and slashes part, already. How do I pass it the remote username, host IP/domain and pw to have it open an ssh2 connection?
rsync ~/mine/ foo@bar:~/their/ soo simple :) -`J' -- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sunday 24 December 2006 16:42, Jan Engelhardt wrote:
On Sunday 24 December 2006 15:53, Jan Engelhardt wrote:
What, care to read its manpage?
I have, but you know how cryptically they're written!
Can't be worse than pure EBNF.
-PHSav is a good thing, the rest is up to you! cron is your friend, and pay attention to rsync directory syntax (you want `rsync -PHSav ~/public_stuff/ master:~/www/`, with trailing slashes)
I'm okay with the flags and slashes part, already. How do I pass it the remote username, host IP/domain and pw to have it open an ssh2 connection?
rsync ~/mine/ foo@bar:~/their/
soo simple :)
Thanks, Jan, it worked like a charm! Carl -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sunday 24 December 2006 12:23, Carl Hartung wrote:
Hi All,
I need to start synchronizing a 'live' website, nightly, with the 'master' copy residing under ~/public_html/ on my local box.
I have user account level ssh access to the server and, when I log in, it 'lands' me at /home/user/ ('~/'), directly above the 'live' website directory at ~/public_html/ (is symlinked to ~/www/).
rsync -a -e ssh --delete <path to ~>/public/ <remote machine>:/home/user/www HTH Mike -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sunday 24 December 2006 13:53, Mike Noble wrote:
On Sunday 24 December 2006 12:23, Carl Hartung wrote:
Hi All,
I need to start synchronizing a 'live' website, nightly, with the 'master' copy residing under ~/public_html/ on my local box.
I have user account level ssh access to the server and, when I log in, it 'lands' me at /home/user/ ('~/'), directly above the 'live' website directory at ~/public_html/ (is symlinked to ~/www/).
rsync -a -e ssh --delete <path to ~>/public/ <remote machine>:/home/user/www
HTH Mike
One more thing on this is ssh will require you to enter your passwd. This does not work with trying to automate (running from cron). To fix this on the local machine (machine sync'ing from) you want to setup ssh keys, this can be don with the following command: ssh-keygen -t dsa (just enter return for all questions) Now you want to copy the id_dsa.pub key to the remote machine. cd ~/.ssh scp id_dsa.pub <remote machine>:/home/user/.ssh ssh into the remote machine cd .ssh cat id_dsa.pub >> authorized_keys (NOTE: make sure the home directory does not allow other write permission (best to prevent group as well) or ssh will see this as a security issue and will not work). Now if you exit out, and if you ssh into the remote machine again you will not be asked for a password. Mike -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sunday 24 December 2006 17:06, Mike Noble wrote:
One more thing on this is ssh will require you to enter your passwd. This does not work with trying to automate (running from cron). To fix this on the local machine (machine sync'ing from) you want to setup ssh keys, this can be don with the following command:
ssh-keygen -t dsa
(just enter return for all questions)
Now you want to copy the id_dsa.pub key to the remote machine.
cd ~/.ssh scp id_dsa.pub <remote machine>:/home/user/.ssh ssh into the remote machine cd .ssh cat id_dsa.pub >> authorized_keys (NOTE: make sure the home directory does not allow other write permission (best to prevent group as well) or ssh will see this as a security issue and will not work).
Now if you exit out, and if you ssh into the remote machine again you will not be asked for a password.
Thanks Mike! This also worked like a charm! Carl -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sun December 24 2006 17:06, Mike Noble wrote:
cat id_dsa.pub >> authorized_keys (NOTE: make sure the home directory does not allow other write permission (best to prevent group as well) or ssh will see this as a security issue and will not work).
Now if you exit out, and if you ssh into the remote machine again you will not be asked for a password.
Hi All (and Mike, if you're here), Let's say I move my work to another server and I want to reverse the passwordless login capability afforded by the above... how to do? TIA & regards, Carl -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Wed February 7 2007 14:59, Carl Hartung wrote:
On Sun December 24 2006 17:06, Mike Noble wrote:
cat id_dsa.pub >> authorized_keys (NOTE: make sure the home directory does not allow other write permission (best to prevent group as well) or ssh will see this as a security issue and will not work).
Now if you exit out, and if you ssh into the remote machine again you will not be asked for a password.
Hi All (and Mike, if you're here),
Let's say I move my work to another server and I want to reverse the passwordless login capability afforded by the above... how to do?
Answering self: "Stop, engage brain and *then* look over the issue." A simple 'rm authorized_keys' and 'rm id_dsa.pub' solved this... doh! Carl -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (3)
-
Carl Hartung
-
Jan Engelhardt
-
Mike Noble