[cs615asa] Re rsync

Jan Schaumann jschauma at cs.stevens.edu
Fri Mar 25 19:23:11 EDT 2011


sdabheka at stevens.edu wrote:

> i am  stuck at command rsync
> as per syntax you gave us
> rsync [flags] [directory] hostname:/remote/dir
> 
> rsync shri.tar root at ec2-50-17-133-133.compute-1.amazonaws.com:/root/shri
> shri.tar is backup file 
> /root/shri is destination path
> when i am executing this command  i got following error
> 
>  Permission denied (publickey,gssapi-with-mic).
> rsync: connection unexpectedly closed (0 bytes received so far) [sender]
> rsync error: error in rsync protocol data stream (code 12) at io.c(601) [sender=3.0.7]
> 
> 
> but if i use 
>  scp -o StrictHostKeyChecking=no -i sp shri.tar root at ec2-50-17-133-133.compute-1.amazonaws.com:/root/shri
> it smoothly gets executed
> 
> so can i use above command or suggest me some other way?

As some of you have found out by now (and as is evident from the options
you passed to scp(1) above), it is a matter of having ssh(1) set up to
use the right options.

Please remember that your program should not have any options hardcoded.
Instead, the user invoking the command would have to specify the right
options in his or her ~/.ssh/config file, as illustrated in:
http://www.cs.stevens.edu/~jschauma/615A/s11-hw2-sample-solution.html#sshconfig


Furthermore, please make sure that you are using rsync(1) to actually
sync the filesystem, not a tar file.  That is, you want to be able to
efficiently and incrementally sync a directory into another directory
(on the remote instance) using rsync, not copy a single file containing
the directory hierarchy.

To illustrate the two ways of doing the backup again (with various
things for you left to fill in):

(1) if "-m rsync" is specified:

rsync <flags> <local directory> hostname:<remote dir>

(2) if "-m dd" is specified (or no "-m" flag is given at all):

tar <flags> <local directory> | ssh hostname "dd of=<mountpoint> <options>"


-Jan


More information about the cs615asa mailing list