On Wed, 2004-05-05 19:00:28 -0800, Web Hosting Network <[EMAIL PROTECTED]>
wrote in message <[EMAIL PROTECTED]>:

[snip]

So you want [EMAIL PROTECTED] to rsync machine_1:/some/path to
[EMAIL PROTECTED] 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 [EMAIL PROTECTED] "cat >> ~/.ssh/authorized_keys"
        $ ssh [EMAIL PROTECTED] "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 [EMAIL PROTECTED]

That should work, now the rsync part:

        machine_1 $>  rsync --rsh="ssh -i /home/user_1/.ssh/rsync-key" -avz 
/path/to/your/files/ [EMAIL PROTECTED]:/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       [EMAIL PROTECTED]    . +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));

Attachment: signature.asc
Description: Digital signature

-- 
To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Reply via email to