On Wed, 2004-05-05 19:00:28 -0800, Web Hosting Network
<hosting@www-hosting.net>
wrote in message <E1BLZ7l-0005p8-D7@sandy.thehideout.net>:
[snip]
So you want user_1@machine_1 to rsync machine_1:/some/path to
user_2@machine2 in a path machine_2:/some/other/path ? This should be
done via ssh, right? Easy, that.
- On machine_2, create ~/.ssh as a directory (if it doesn't already exist)
- On machine_1, do:
$ mkdir ~/.ssh
$ cd ~/.ssh
$ ssh-keygen -f rsync-key -t rsa -C "key for rsync"
(-> NO password)
$ cat rsync-key.pub | ssh user_2@machine_2 "cat >>
~/.ssh/authorized_keys"
$ ssh user_2@machine_2 "chmod 0640 ~/.ssh/authorized_keys"
(This created a ssh key and allows user_1 to log in as user_2 on
machine_2 without password)
Now, ssh'ing into machine_2 with user_2 should work, try it:
machine_1 $> ssh -i ~/.ssh/rsync-key user_2@machine_2
That should work, now the rsync part:
machine_1 $> rsync --rsh="ssh -i /home/user_1/.ssh/rsync-key"
-avz /path/to/your/files/ user_2@machine_2:/path/to/backup
That should work, too, so you can place that command into user_1's
crontab file. rsync's options (I choose -avz here) depend on what you
actually want to achieve, you didn't tell that exactly enough so I took
something that basically does a backup (-a), is a bit verbose (-v) and
compresses data over the link (-z). Especially -z is only wise if you've
got a slow link in between and fast CPUs. Omit it if you're in LAN with
not-that-fast CPUs.
MfG, JBG
--
Jan-Benedict Glaw jbglaw@lug-owl.de . +49-172-7608481
"Eine Freie Meinung in einem Freien Kopf | Gegen Zensur | Gegen
Krieg
fuer einen Freien Staat voll Freier B?rger" | im Internet! | im Irak!
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM |
TCPA));
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url :
http://lists.samba.org/archive/rsync/attachments/20040506/492fa4a4/attachment.bin