Darragh Bailey
2004-11-16 22:19:32 UTC
Trying to use rsync to update a local copy of a website from the one sitting on
a server.
Normally I can use
rsync -vare ssh ***@host:src_dir/* local_dir/ --exclude-from=local_dir/EXCL
But in this case I need to be able to switch user after login in order to
retreive the files fully due to permissions, before any one askes its not root,
but a common website editing account shared between a few members. Additionally
loging in remotely as the shared user will not work either.
I was looking at
rsync -var --rsh="ssh -l user host su - new_user" :src_dir/* local_dir/
--exclude-from=local_dir/EXCL
But rsync terminates the connection. Is it possible to do it this way, in which
case could someone point out what I'm missing or do I have to resort to a script
in order to be able to perform this?
output from rsync is
bash: su - new_user: command not found
rsync: connection unexpectedly closed (0 bytes read so far)
rsync error: error in rsync protocol data stream (code 12) at io.c(342)
experimenting from the command line with just ssh gets the message
su: must be run from a terminal
So that suggests what the problem rsync is having but isn't any assistance in
building a new command line that would work.
Setting up a script on the far side to run when I login is no good since I
sometimes need to be able to ssh in without becoming a different user
afterwards.
Additionally taring and bziping the website up and downloading it is not really
an option. Once in a while that can be done, the rest of the time I need to be
able to use either rsync over ssh or some other system than only retreives
modified files over ssh.
--
Darragh
"Nothing's foolproof to a sufficently talented fool"
a server.
Normally I can use
rsync -vare ssh ***@host:src_dir/* local_dir/ --exclude-from=local_dir/EXCL
But in this case I need to be able to switch user after login in order to
retreive the files fully due to permissions, before any one askes its not root,
but a common website editing account shared between a few members. Additionally
loging in remotely as the shared user will not work either.
I was looking at
rsync -var --rsh="ssh -l user host su - new_user" :src_dir/* local_dir/
--exclude-from=local_dir/EXCL
But rsync terminates the connection. Is it possible to do it this way, in which
case could someone point out what I'm missing or do I have to resort to a script
in order to be able to perform this?
output from rsync is
bash: su - new_user: command not found
rsync: connection unexpectedly closed (0 bytes read so far)
rsync error: error in rsync protocol data stream (code 12) at io.c(342)
experimenting from the command line with just ssh gets the message
su: must be run from a terminal
So that suggests what the problem rsync is having but isn't any assistance in
building a new command line that would work.
Setting up a script on the far side to run when I login is no good since I
sometimes need to be able to ssh in without becoming a different user
afterwards.
Additionally taring and bziping the website up and downloading it is not really
an option. Once in a while that can be done, the rest of the time I need to be
able to use either rsync over ssh or some other system than only retreives
modified files over ssh.
--
Darragh
"Nothing's foolproof to a sufficently talented fool"
--
Irish Linux Users' Group
http://www.linux.ie/mailman/listinfo/ilug/
Irish Linux Users' Group
http://www.linux.ie/mailman/listinfo/ilug/