Re: [BackupPC-users] appending to the Excludes hash
Craig Barratt wrote: > It's ok putting code in config.pl, but you should be aware that if you use > the CGI editor, it will not survive. ah -- thanks for that. i don't use that editor, but i can imagine being tempted to learn how someday. i guess i'll avoid the temptation. paul > > Craig > > On Thursday, May 4, 2017, Paul Fox wrote: > > > Bowie Bailey wrote: > > > On 5/4/2017 10:35 AM, Paul Fox wrote: > > > > > > > > is there a nice perl way to do something like this? syntax > > > > intentionally left vague: > > > > > > > > $Conf{BackupFilesExclude} += { ... '/home' } > > > > > > > > i'd like to be able to append to either the '*' catchall array > > > > or a share-specific array. > > > > > > Off the top of my head, you could do it like this: > > > > > > push @{$Conf{BackupFilesExclude}{'*'}}, '/dir1', '/dir2', '/dir3'; > > > push @{$Conf{BackupFilesExclude}{'/'}}, '/dir4', '/dir5', '/dir6'; > > > > thanks! syntax was perfect. > > > > paul =-- paul fox, p...@foxharp.boston.ma.us (arlington, ma, where it's 52.7 degrees) -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ 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] appending to the Excludes hash
It's ok putting code in config.pl, but you should be aware that if you use the CGI editor, it will not survive. Craig On Thursday, May 4, 2017, Paul Fox wrote: > Bowie Bailey wrote: > > On 5/4/2017 10:35 AM, Paul Fox wrote: > > > > > > is there a nice perl way to do something like this? syntax > > > intentionally left vague: > > > > > > $Conf{BackupFilesExclude} += { ... '/home' } > > > > > > i'd like to be able to append to either the '*' catchall array > > > or a share-specific array. > > > > Off the top of my head, you could do it like this: > > > > push @{$Conf{BackupFilesExclude}{'*'}}, '/dir1', '/dir2', '/dir3'; > > push @{$Conf{BackupFilesExclude}{'/'}}, '/dir4', '/dir5', '/dir6'; > > thanks! syntax was perfect. > > paul > =-- > paul fox, p...@foxharp.boston.ma.us (arlington, ma, where > it's 54.9 degrees) > > > > -- > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > ___ > 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/ > -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot___ 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] appending to the Excludes hash
Bowie Bailey wrote: > On 5/4/2017 10:35 AM, Paul Fox wrote: > > > > is there a nice perl way to do something like this? syntax > > intentionally left vague: > > > > $Conf{BackupFilesExclude} += { ... '/home' } > > > > i'd like to be able to append to either the '*' catchall array > > or a share-specific array. > > Off the top of my head, you could do it like this: > > push @{$Conf{BackupFilesExclude}{'*'}}, '/dir1', '/dir2', '/dir3'; > push @{$Conf{BackupFilesExclude}{'/'}}, '/dir4', '/dir5', '/dir6'; thanks! syntax was perfect. paul =-- paul fox, p...@foxharp.boston.ma.us (arlington, ma, where it's 54.9 degrees) -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ 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] appending to the Excludes hash
On 5/4/2017 10:35 AM, Paul Fox wrote: > i guess this question is really about perl syntax, but it might > be something commonly done by backuppc users, so here goes: > > i have the following in my global config: > > $Conf{BackupFilesExclude} = { >'/' => [ > '/proc', > '/sys', > ], >'*' => [ > '.cache', > '.gvfs', > 'slocate.db', > 'ID', > '*._nobackup_', > '*.o' > ] > }; > > > sometimes i wish to augment this list for a particular host: > > $Conf{BackupFilesExclude} = { >'/' => [ > '/home', # /home is backed up separately on this host > '/proc', > '/sys', > ], >'*' => [ > '.cache', > '.gvfs', > 'slocate.db', > 'ID', > '*._nobackup_', > '*.o' > ] > }; > > clearly it would be cleaner not to have to duplicate the entire > data structure in the host's config file. > > is there a nice perl way to do something like this? syntax > intentionally left vague: > > $Conf{BackupFilesExclude} += { ... '/home' } > > i'd like to be able to append to either the '*' catchall array > or a share-specific array. Off the top of my head, you could do it like this: push @{$Conf{BackupFilesExclude}{'*'}}, '/dir1', '/dir2', '/dir3'; push @{$Conf{BackupFilesExclude}{'/'}}, '/dir4', '/dir5', '/dir6'; You can also use an array instead of listing the new entries: push @{$Conf{BackupFilesExclude}{'*'}}, @newstuff; Untested, so the syntax may not be perfect... -- Bowie -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ 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/