BackupPC-users

Re: [BackupPC-users] how to make a backup available as a backup basis for another client?

2009-01-21 03:22:16
Subject: Re: [BackupPC-users] how to make a backup available as a backup basis for another client?
From: Juergen Harms <Juergen.Harms AT unige DOT ch>
Date: Wed, 21 Jan 2009 09:18:53 +0100
I did some googling (rsync tutorial, rsync tutorial filter) - quite some 
good stuff, but not much on filtering. Have a look yourself. The best - 
but not easy-to-read - document is the rsync man page. Here are 2 examples

http://linux.byexamples.com/archives/305/filter-what-to-backup-with-rsync/
http://everythinglinux.org/rsync/

There is a confusion between "filter files", "exclude files", "include 
files" - they all do more or less the same, and observe the same syntax.

I use a GUI frontend to sync some directory zones between hosts. Syncing 
the zone "common" (defined in the clients /etc/rsync.d file" generates 
the following command (I include everything in order to illustrate what 
can be done, many things you do not need):

rsync --log-format=%n%L\ %i\ %t --progress --links --filter=-C 
--hard-links --filter=:\ .syncPerDirFilter --filter=.\ 
/home/harms/tmp/usync_6582 --modify-window=1 -rzvDnuogpt 
ltjuergen.unige.ch::common/  /home/harms/common/

--log-format and --progress
        generate formatted log statements to help the GUI interpreter
        do its job - you will not need this
--links
        symbolic links are transferred as symbolic links
--filter=-C
        excludes files like backup files etc. from being transferred
--hardlinks
        hard links are transferred as hard links
--filter=:\ .syncPerDirFilter
        merge the filter rules you provide on your command line with
        filter rules that are specific to specific directories on your
        client - the file .syncPerDirFilter, if it exists in a directory
        contains these rules. Very usefuls if you apply the same rsync
        command to different machines machines and want to suppress
        syncing machine-specific files
--filter=.\ /home/harms/tmp/usync_6582
        a filter file (example below) generated by my GUI and allowing
        to select the set of sub-directories you want to sync on a case
        by case scenario
--modify-window=1
        tells rsync that matiching times between the server and the
        client should have a 1 millisecond tolerance (to allow for
        slightly different clocks)
the other options are evident, see the rsync manual (the n option is 
there since I run the GUI as a dry-run to produce this example).

<pcjuergen ~> more tmp/usync_6582
+ /.mm_folders/
+ /.mm_folders/**
+ /.Skype/
+ /.Skype/**
+ /.tel/
+ /.tel/**
+ /aaa-pweg/
+ /aaa-pweg/**
+ /avr/
+ /avr/**
+ /BackupPC/
+ /BackupPC/**
    snip
+ /.directory
+ /abook.mab
+ /bookmarks.html
+ /browser_home.html
+ /kde-config
+ /MemoGmunden
+ /ModLog
- *

The items before the snip save the directory and than go down to the 
next level (slightly redundant to the -r option, I need this to allow to 
pilot by the GUI what is and what is not saved), after the snip are 
files. The - * is a match-all statement making rsync skip all nodes for 
which there is no hit in the filter file. I only use includes (+), (-) 
items would exclude files. Rsync reads the filter file for each node 
until it finds a matching rule, does what the rule says, skips all 
remaining rules and starts with the next node.

What you will need is probably just use -r and have a filter file to 
exclude the nodes you do not need ("- /<something>")


------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
BackupPC-users mailing list
BackupPC-users AT lists.sourceforge DOT net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/