Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: cron'ing rsync over ssh

From: Mark Leisher <mleisher(at)crl.NMSU.Edu>
Date: Fri Mar 21 2003 - 12:07:02 EST

>> * Jesse Burkhardt <jesse@skybuilders.com> [2003-03-19 04:03]:

I'm almost done setting up a special backup system that needed this very thing. Here's a sketch of what you need to do:

Our situation - create incremental backups of several critical file systems using rsync (http://www.mikerubel.org/computers/rsync_snapshots).

  1. Create a key specifically for rsync on the backup host as root:

   # ssh-keygen -t dsa -C '' -N '' > ~/.ssh/rsync-key

2. Copy the rsync public key file from the backup host to the machines

   containing the desired file systems:

   # foreach i (machine1 machine2 machine3)    > ssh $i cat copy-of-rsync-key.pub >> ~/.ssh/authorized_keys    > end

Do you need help?X

3. On the backup host, create a shell script for ssh-agent that does the

   backup:

   #!/bin/sh

   #
   # This script is run by ssh-keygen to a) add the private key to ssh-agent
   # and b) run the backup using rsync.
   #

   ssh-add $HOME/.ssh/rsync-key

   for i in machine1 machine2 machine3; do      rsync -az $i:/some/file/system /local/directory    done

4. Run the backup process (where backup.sh is the shell script described

   above):

   # ssh-agent backup.sh



Mark Leisher
Computing Research Lab                    Let Saddam run a movie studio.
New Mexico State University               He can make bombs there.
Box 30001, Dept. 3CRL                        -- Robin Williams
Las Cruces, NM 88003 Received on Fri Mar 21 13:17:40 2003
Do you need more help?X

This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 14:02:55 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library