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/