Re: Problem with rsync backup

Gustin Johnson <[email protected]>
Newsgroups gmane.org.user-groups.linux.calgary.general
Message-ID <CAPM=hj6znzME_E-Jr_3HHK-qeQD=H7Lkw3RBUohs4QcWAjWhHg@mail.gmail.com>
I took a different approach to my backups.  I specify the directories that
i want to backup in an array (this is all in bash btw), then iterate over
each item in the array:

declare -a  sourcedir=( "/etc" "/usr/local" "/home" )
elements="${#sourcedir[*]}"
  for (( i = 0  ; i < $elements ; i++ ))
  do
  rsync -t -ruz --progress --delete --inplace --rsh="ssh -p $PORT -i
$SSH_KEY" ${sourcedir[$i]} $USERNAME@$HOST:$REMOTE_PATH
  done

I have an old script that demonstrates this:
https://github.com/meganerd/bash_scripts/blob/master/backup/BackupWrapper.sh

Hth,


On Sat, Aug 15, 2015 at 3:00 PM, Joe S <[email protected]> wrote:

> I Thought I was doing that with the filter rule:
> + /home/
> + /home/joe/
> - /home/*
> - /home/joe/.cache/
> + /root/
> + /boot/
> + /etc/
> + /usr/
> + /usr/local/
> - /usr/*
> - *
>
> I use that for backing up some of my home directories and files to a
> flash drive, but I have some mistake when trying to backup / to my
> external drive since it is also backing up other directories that I
> don't want as well as a loop. If I can't figure how to change this I'll
> try the exclude.
>
> On Sat, 15 Aug 2015 13:14:13 -0600
> Hendrik Schaink <[email protected]> wrote:
>
> > Make sure you exclude the mount point for your back-up drive, i.e.
> > --exclude=/media/root-backup
> > _OR_ adding it to the command-line argument
> > rsync $OPT --exclude=$TRG $SRC $TRG
> > or otherwise you this could create an infinite backup loop that tries
> > to backup the backup plus it's backup plus....
> >
> > HTH,
> >
> > Hendrik Schaink
> >
> >
> > On 15-08-14 11:53 AM, Joe S wrote:
> > > I am trying to backup my computer to an external drive using rsync.
> > >  From / to /media/root-backup
> > > The problem: rsync copies more directories than I want and it
> > > copies /media/root-backup multiple times.
> > >
> > > I have included my backup script and filter rule file.
> > > Hoping someone will see the mistake.
> > >
> > > Thanks
> > >
> > >
> > >
> > > _______________________________________________
> > > clug-talk mailing list
> > > [email protected]
> > > http://clug.ca/mailman/listinfo/clug-talk_clug.ca
> > > Mailing List Guidelines (http://clug.ca/ml_guidelines.php)
> > > **Please remove these lines when replying
> > >
> >
> > _______________________________________________
> > clug-talk mailing list
> > [email protected]
> > http://clug.ca/mailman/listinfo/clug-talk_clug.ca
> > Mailing List Guidelines (http://clug.ca/ml_guidelines.php)
> > **Please remove these lines when replying
>
>
> _______________________________________________
> clug-talk mailing list
> [email protected]
> http://clug.ca/mailman/listinfo/clug-talk_clug.ca
> Mailing List Guidelines (http://clug.ca/ml_guidelines.php)
> **Please remove these lines when replying
>

_______________________________________________
clug-talk mailing list
[email protected]
http://clug.ca/mailman/listinfo/clug-talk_clug.ca
Mailing List Guidelines (http://clug.ca/ml_guidelines.php)
**Please remove these lines when replying
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.