[BackupPC-users] rsync exclusion list - apply to multiple shares

2016-09-19 Thread cardiganimpatience
Just following up on this because I got a very useful reply from Holger which 
explained that a variable can be used to hold a list of excludes, but noted 
that doing so will break the ability to use the GUI. If the GUI is used to edit 
a host's config after manually setting a variable all changes will be 
overwritten.

>From Holger:

You simply create a variable in the host (or even global) config file ...

my @common_excludes = '*access_log*', 
'.apdisk', '.cache';

and then reference that multiple times:

$Conf BackupFilesExclude = 
'/home' =>  
@common_excludes ,
'/var' =>  
@common_excludes, '/lib/mysql' ,
'/usr' =>  
@common_excludes ,
'/boot' =>  
@common_excludes ,
'/data' =>  
@common_excludes ,
;

or

$Conf BackupFilesExclude = 
'/var'  
=>  @common_excludes, '/lib/mysql' ,
'/example' =>  
,  # no excludes here
'*'   
 =>  @common_excludes ,
;


Thanks Holger for your help! I've implemented it and it saves me much messiness 
in my config files.  8)

+--
|This was sent by itism...@gmail.com via Backup Central.
|Forward SPAM to ab...@backupcentral.com.
+--



--
___
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/


Re: [BackupPC-users] rsync exclusion list - apply to multiple shares

2016-08-31 Thread Holger Parplies
Hi,

cardiganimpatience wrote on 2016-08-19 06:24:24 -0700 [[BackupPC-users]  rsync 
exclusion list - apply to multiple shares]:
> [...]
> 
> $Conf{BackupFilesExclude} = {
>   '*' => [
> '*access_log*',
> '.apdisk',
> '*/.apdisk',
> '.cache'
>   ]

};

(supplied free of charge).

> Is there a method to make an exclusion list for all shares, even if
> individual shares have specific lists of their own?

That question doesn't make sense, but I presume you want a global exclusion
list that applies in addition to optional individual share lists. You can get
close to what you want, but you'll break the web configuration editor, or
rather, the web configuration editor will not correctly preserve your changes
if you use it on the host configuration file(s) in question.

You simply create a variable in the host (or even global) config file ...

my @common_excludes = ('*access_log*', '.apdisk', '*/.apdisk','.cache');

(I'm not sure what you are trying to achieve by listing '*/.apdisk' as well
as '.apdisk', though) and then referencing that multiple times:

$Conf {BackupFilesExclude} = {
'/home' => [ @common_excludes ],
'/var'  => [ @common_excludes, '/lib/mysql' ],
'/usr'  => [ @common_excludes ],
'/boot' => [ @common_excludes ],
'/data' => [ @common_excludes ],
};

or

$Conf {BackupFilesExclude} = {
'/var' => [ @common_excludes, '/lib/mysql' ],
'/example' => [ ], # no excludes here
'*'=> [ @common_excludes ],
};

> Would it be valid to list all shares in a common definition, and also break
> them out into individual lists like this:
> 
> $Conf{BackupFilesExclude} = {
>   '/home, /var, /usr, /boot, /data' => [
> '*access_log*',
> '.apdisk',
> '*/.apdisk',
> '.cache'
>   ]
> 
> $Conf{BackupFilesExclude} = {
>   '/var' => [
> '/lib/mysql'
> ]

Well, syntactically you are missing closing braces and a semicolon.
Semantically, you are assigning one value and then overwriting it with
another, just like in

$a = 'foo';
$a = 'bar';

For BackupPC, you are first creating an exclude list for a share with the
somewhat awkward name '/home, /var, /usr, /boot, /data' (which is "data"
within "boot, " within "usr, " within "var, " within "home, " within the
root directory), which is doubtlessly a valid path, just not one whose
name you'd like to quote to a shell.

So, no, that won't work for several reasons. Aside from that, it would also
break the web configuration editor.

> My list of files to exclude from every ShareName includes over 40 items
> so it's not trivial (or aesthetically pleasing) to append this list to
> each share definition.

Considering "trivial", I tend to disagree, at least with vi ;-). Consistently
*changing* the list might be a different matter. But I agree with your point.


As a side note, I believe you can prevent a host configuration file from
being edited (by the user) with the web configuration editor by setting

$Conf{CgiUserConfigEditEnable} = 0;

(inside the host configuration file). This might be advisable if you made
changes incompatible with the web configuration editor to prevent accidental
damage. Note, though, that this will probably not prevent an *admin* user
from clobbering the file with the web configuration editor.

Regards,
Holger

--
___
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/


[BackupPC-users] rsync exclusion list - apply to multiple shares

2016-08-19 Thread cardiganimpatience
I was under the incorrect assumption that specifying an asterisk would apply 
the exclusion list to all ShareNames until I struggled with making it work and 
re-read the tutorial [1] where it specifies that the asterisk "means it applies 
to all shares that don't have a specific entry".

$Conf{BackupFilesExclude} = {
  '*' => [
'*access_log*',
'.apdisk',
'*/.apdisk',
'.cache'
  ]

Is there a method to make an exclusion list for all shares, even if individual 
shares have specific lists of their own? For example, I want to exclude the 
/var/lib/mysql folder on the /var share, but I also want to exclude any 
directory named .cache from all shares. 

Would it be valid to list all shares in a common definition, and also break 
them out into individual lists like this:

$Conf{BackupFilesExclude} = {
  '/home, /var, /usr, /boot, /data' => [
'*access_log*',
'.apdisk',
'*/.apdisk',
'.cache'
  ]

$Conf{BackupFilesExclude} = {
  '/var' => [
'/lib/mysql'
]


My list of files to exclude from every ShareName includes over 40 items so it's 
not trivial (or aesthetically pleasing) to append this list to each share 
definition.

[1] http://backuppc.sourceforge.net/faq/BackupPC.html#_conf_backupfilesexclude_

+--
|This was sent by itism...@gmail.com via Backup Central.
|Forward SPAM to ab...@backupcentral.com.
+--



--
___
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/