how to take least risk on rsync dir

Patrick Hsieh pahud at pahud.net
Tue Apr 16 02:48:01 EST 2002


Hello John Schaaf <john at kliek.xs4all.nl>,

After reading your mail, I wrote a little script:

#!/bin/sh

localdir=/backup/infotimes
localbkupdir=/backup/infotimes_bakup
remotedir=home::usrlocalinfotimes

rsync -av --backup --backup-dir=$localbkupdir --delete \
$remotedir $localdir



When I run this script, it does not make any backup under $localbkupdir.
Any idea?



On Tue, 16 Apr 2002 11:26:42 +0200
John Schaaf <john at kliek.xs4all.nl> wrote:

> Patrick Hsieh wrote:
> 
> >Hello list,
> >
> >When rsync dir_A to dir_B, I hope I wont make any change to the original
> >dir_B unless the rsync procedure end withour errors, therefore, I hope
> >there's somethig like
> >
> >rsync -av dir_A dir_B_tmp && \
> >mv dir_B dir_B.bkup &&
> >mv dir_B_tmp dir_B
> >
> >This small script can ensure the minimal change time between 2 versions
> >of archive. Is this built in the native rsync function? Do I have to
> >write scripts myself?
> >
> You mean the '--backup'  and '--backup-dir'  options? I use a line like:
> rsync -av --backup --backup-dir=/mnt/backup/$DAY/homes --delete 
> tux::home /mnt/backup/homes
> $DAY is declared earlier with DAY=`date +%A`
> 
> This line makes a backup from the rsync server (/home) to a local disk 
> (/mnt/backup/homes). It deletes removed files but makes a backup in 
> /mnt/backup/$DAY with a one week rotation (I just rsync an empty dir to 
> the /mnt/backup/$DAY dir before the actual backup)
> 
> johns

-- 
Patrick Hsieh <pahud at pahud.net>
GPG public key http://pahud.net/pubkeys/pahudatpahud.gpg






More information about the rsync mailing list