a question of backup

Gabriel Dragffy dragffy at yandex.ru
Mon Feb 27 09:36:52 UTC 2006


Hi thanks for the reply, can I use this script locally not for ssh? To copy 
from my /hom (an internal partition) to my USB Drive? /media/sdb1 (I think)?


On Monday 27 February 2006 16:14, Gustav H Meyer wrote:
> Hi Gabriel,
>
> On 26/02/06 09:03, Gabriel Dragffy wrote:
> > ...If someone is able to write me an example script for its
> > execution in creating a fast mirror back up (i.e. only copied
> > changed/new files and deletes others NOT recopying everything)
> > I'd really appreciate it.
>
> A quick script using rsync with ssh:
>       1  #!/bin/sh
>       2  # mirror - Mirror files from RemoteServers to LocalServer
>
>       3  LOGFILE=/data/logs/mirror/`date +%Y%m%d%H%M%S`.log
>
>       4  # Limit the bandwidth on a slow / busy network
>       5  BWLIMIT=256
>
>       6  RSYNC="/usr/local/bin/rsync -avze /usr/bin/ssh
> --bwlimit=$BWLIMIT --delete"
>       7  LocalDir=/data/backups/servers
>
>       8  echo Start: `date`
>       9  echo LogFile: $LOGFILE
>
>      10  # Start a new logfile
>      11  echo Starting at: `date` > $LOGFILE
>
>      12  echo RemoteServerA >> $LOGFILE
>      13  $RSYNC RemoteServerA:/src/dir/
> $LocalDir/RemoteServerA/dst/dir >> $LOGFILE
>
>      14  echo RemoteServerB >> $LOGFILE
>      15  $RSYNC --exclude 'logs/' RemoteServerB:/src/dir/
> $LocalDir/RemoteServerB/dst/dir >> $LOGFILE
>
>      16  echo  >> $LOGFILE
>      17  echo Ending at: `date` >> $LOGFILE
>      18  echo Stop: `date`
>
> Regards,
> Gustav H Meyer




More information about the kubuntu-users mailing list