rsync was Re: [lug] ssh compression

Hugh Brown hugh at vecna.com
Tue May 7 08:27:55 MDT 2002


One other question.  Before I was using ssh's ability to limit the
command run on dst-host in the authorized_keys file
(from="src-host",command="/usr/bin/rsync").  The problem is rsync was
dying (unexpected EOF or something similar).  Anyone know what the right
command is?

Hugh


On Tue, 2002-05-07 at 10:22, Hugh Brown wrote:
> Thanks to all those who contributed.  Peter suggested I do a backup of
> the stuff that I rsync over.  I get to be able to restore to a given
> point in time and I don't get killed on the bandwidth.
> 
> This is what I have right now for the rsync part:
> 
> #!/bin/bash
> 
> # make the filesystem writable
> /bin/mount -o remount,rw /backup
> 
> # Tell rsync to use ssh as the transfer mechanism
> RSYNC_RSH=/usr/bin/ssh
> export RSYNC_RSH=/usr/bin/ssh
> # List of dirs on dst-host to backup
> BACKUP_DIRS="/var/named /etc /var/spool/mail /home"
> 
> # rsync only likes one directory at a time
> for DIR in $BACKUP_DIRS; do
> 
>   /usr/bin/rsync --verbose \
>                  --backup-dir /backup/rsync/dst-host.bak \
>                  --update \
>                  --stats \
>                  --bwlimit=16 \
>                  --relative \
>                  --archive \
>                  --compress \
>                  --delete \
>                  dst-host:${DIR} \
>                  /backup/rsync/dst-host/
> 
> done
> 
> # Make sure all data has been written out and then remount
> # the filesystem read-only
> 
> /bin/sync;/bin/sync;/bin/sync
> /bin/umount /backup
> # fsck gripes about how often the filesystem is mounted
> /sbin/fsck -a /dev/hdc1
> /bin/mount /backup
> /bin/date
> 
> 
> Am I doing anything obviously stupid?
> 
> I want the host that I run the script from just to copy down what's on
> dst-host.  I never want it to delete anything on dst-host, but if
> something disappears on dst-host, I want it to be deleted on the
> src-host.
> 
> Also, my isp's bandwidth limit is 128kbps.  The --bwlimit is in Kbytes. 
> Am I right in setting it at 16 because 128k bit/s * (1 byte/8 bit) = 16
> Kbytes/s.
> 
> Thanks again for all the help.
> 
> Hugh 
> 
> 
> 
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> Join us on IRC: lug.boulder.co.us port=6667 channel=#colug





More information about the LUG mailing list