[slbackup-commit] CVS update: slbackup/src slbackup-cron

werner-guest@alioth.debian.org werner-guest@alioth.debian.org
Wed, 03 Nov 2004 10:34:53 -0700


  User: werner-guest
  Date: 04/11/03 10:34:53

  Modified:    src      slbackup-cron
  Log:
  added the exclude option
  
  Revision  Changes    Path
  1.9       +21 -1     slbackup/src/slbackup-cron
  
  Index: slbackup-cron
  ===================================================================
  RCS file: /cvsroot/slbackup/slbackup/src/slbackup-cron,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- slbackup-cron	3 Nov 2004 17:31:59 -0000	1.8
  +++ slbackup-cron	3 Nov 2004 17:34:53 -0000	1.9
  @@ -183,6 +183,26 @@
   
       # build execute string
       my $execstr = "rdiff-backup --print-statistics ";
  +    
  +    if (exists ($config->{client}->{$key}->{exclude})) {
  +	if (ref ($config->{client}->{$key}->{exclude}) eq "ARRAY") {
  +	    # there is more than one location to exclude (=> exclude
  +	    # is an array)
  +	    for my $loc (@{$config->{client}->{$key}->{exclude}}) {
  +		$execstr .= "--exclude $loc ";
  +	    }
  +	} else {
  +	    # there is only one location to exclude (=> exclude is a string)
  +	    my $loc = $config->{client}->{$key}->{exclude};
  +	    $execstr .= "--exclude $loc ";
  +	}
  +    }
  +    
  +    # We don't want to cause an endless loop... ;)
  +    if (exists ($config->{client}->{$key}->{type}) and
  +       $config->{client}->{$key}->{type} eq "local") {
  +       $execstr .= "--exclude $config->{server_destdir} ";
  +    }
   
       # include clients locations if exists
       if (!exists ($config->{client}->{$key}->{location})) {