1 #============================================================= -*-perl-*-
3 # BackupPC::Config::Meta package
7 # This library defines a BackupPC::Config::Meta class.
10 # Craig Barratt <cbarratt@users.sourceforge.net>
13 # Copyright (C) 2004 Craig Barratt
15 # This program is free software; you can redistribute it and/or modify
16 # it under the terms of the GNU General Public License as published by
17 # the Free Software Foundation; either version 2 of the License, or
18 # (at your option) any later version.
20 # This program is distributed in the hope that it will be useful,
21 # but WITHOUT ANY WARRANTY; without even the implied warranty of
22 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 # GNU General Public License for more details.
25 # You should have received a copy of the GNU General Public License
26 # along with this program; if not, write to the Free Software
27 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 #========================================================================
31 # Version 3.0.0alpha, released 23 Jan 2006.
33 # See http://backuppc.sourceforge.net.
35 #========================================================================
37 package BackupPC::Config::Meta;
43 use vars qw( @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS );
45 use vars qw(%ConfigMeta);
56 'all' => [ @EXPORT_OK ],
60 # Define the data types for all the config variables
65 ######################################################################
66 # General server configuration
67 ######################################################################
68 ServerHost => "string",
69 ServerPort => "integer",
70 ServerMesgSecret => "string",
71 MyPath => {type => "string", undefIfEmpty => 1},
72 UmaskMode => "integer",
77 MaxBackups => "integer",
78 MaxUserBackups => "integer",
79 MaxPendingCmds => "integer",
80 MaxBackupPCNightlyJobs => "integer",
81 BackupPCNightlyPeriod => "integer",
82 MaxOldLogFiles => "integer",
84 SshPath => {type => "execPath", undefIfEmpty => 1},
85 NmbLookupPath => {type => "execPath", undefIfEmpty => 1},
86 PingPath => {type => "execPath", undefIfEmpty => 1},
87 DfPath => {type => "execPath", undefIfEmpty => 1},
89 SplitPath => {type => "execPath", undefIfEmpty => 1},
90 ParPath => {type => "execPath", undefIfEmpty => 1},
91 CatPath => {type => "execPath", undefIfEmpty => 1},
92 GzipPath => {type => "execPath", undefIfEmpty => 1},
93 Bzip2Path => {type => "execPath", undefIfEmpty => 1},
94 DfMaxUsagePct => "float",
95 TrashCleanSleepSec => "integer",
96 DHCPAddressRanges => {
102 order => [qw(ipAddrBase first last)],
104 ipAddrBase => "string",
110 BackupPCUser => "string",
112 InstallDir => "string",
116 BackupPCUserVerify => "boolean",
117 HardLinkMax => "integer",
124 ServerInitdPath => {type => "string", undefIfEmpty => 1},
125 ServerInitdStartCmd => "string",
127 ######################################################################
128 # What to backup and when to do it
129 # (can be overridden in the per-PC config.pl)
130 ######################################################################
131 FullPeriod => "float",
132 IncrPeriod => "float",
137 FullKeepCntMin => "integer",
138 FullAgeMax => "float",
139 IncrKeepCnt => "integer",
140 IncrKeepCntMin => "integer",
141 IncrAgeMax => "float",
142 PartialAgeMax => "float",
143 IncrFill => "boolean",
144 RestoreInfoKeepCnt => "integer",
145 ArchiveInfoKeepCnt => "integer",
156 BackupFilesExclude => {
166 BlackoutBadPingLimit => "integer",
167 BlackoutGoodCnt => "integer",
175 hourBegin => "float",
185 BackupZeroFilesIsFatal => "boolean",
187 ######################################################################
188 # How to backup a client
189 ######################################################################
192 values => [qw(archive rsync rsyncd smb tar)],
194 XferLogLevel => "integer",
196 ClientCharset => "string",
202 SmbShareUserName => "string",
203 SmbSharePasswd => "string",
204 SmbClientPath => {type => "string", undefIfEmpty => 1},
205 SmbClientFullCmd => "string",
206 SmbClientIncrCmd => "string",
207 SmbClientRestoreCmd => "string",
213 TarClientCmd => "string",
214 TarFullArgs => "string",
215 TarIncrArgs => "string",
216 TarClientRestoreCmd => "string",
217 TarClientPath => {type => "string", undefIfEmpty => 1},
223 RsyncClientPath => {type => "string", undefIfEmpty => 1},
224 RsyncClientCmd => "string",
225 RsyncClientRestoreCmd => "string",
227 RsyncdClientPort => "integer",
228 RsyncdPasswd => "string",
229 RsyncdAuthRequired => "boolean",
231 RsyncCsumCacheVerifyProb => "float",
237 RsyncRestoreArgs => {
243 ArchiveDest => "string",
246 values => [qw(none bzip2 gzip)],
248 ArchivePar => "boolean",
249 ArchiveSplit => "float",
250 ArchiveClientCmd => "string",
252 NmbLookupCmd => "string",
253 NmbLookupFindHostCmd => "string",
255 FixedIPNetBiosNameCheck => "boolean",
257 PingMaxMsec => "float",
259 ClientTimeout => "integer",
261 MaxOldPerPCLogFiles => "integer",
263 CompressLevel => "integer",
265 DumpPreUserCmd => {type => "string", undefIfEmpty => 1},
266 DumpPostUserCmd => {type => "string", undefIfEmpty => 1},
267 DumpPreShareCmd => {type => "string", undefIfEmpty => 1},
268 DumpPostShareCmd => {type => "string", undefIfEmpty => 1},
269 RestorePreUserCmd => {type => "string", undefIfEmpty => 1},
270 RestorePostUserCmd => {type => "string", undefIfEmpty => 1},
271 ArchivePreUserCmd => {type => "string", undefIfEmpty => 1},
272 ArchivePostUserCmd => {type => "string", undefIfEmpty => 1},
274 ClientNameAlias => {type => "string", undefIfEmpty => 1},
276 ######################################################################
277 # Email reminders, status and messages
278 # (can be overridden in the per-PC config.pl)
279 ######################################################################
280 SendmailPath => {type => "execPath", undefIfEmpty => 1},
281 EMailNotifyMinDays => "float",
282 EMailFromUserName => "string",
283 EMailAdminUserName => "string",
284 EMailUserDestDomain => "string",
285 EMailNoBackupEverSubj => {type => "string", undefIfEmpty => 1},
286 EMailNoBackupEverMesg => {type => "bigstring", undefIfEmpty => 1},
287 EMailNotifyOldBackupDays => "float",
288 EMailNoBackupRecentSubj => {type => "string", undefIfEmpty => 1},
289 EMailNoBackupRecentMesg => {type => "bigstring", undefIfEmpty => 1},
290 EMailNotifyOldOutlookDays => "float",
291 EMailOutlookBackupSubj => {type => "string", undefIfEmpty => 1},
292 EMailOutlookBackupMesg => {type => "bigstring", undefIfEmpty => 1},
293 EMailHeaders => {type => "bigstring", undefIfEmpty => 1},
295 ######################################################################
296 # CGI user interface configuration settings
297 ######################################################################
298 CgiAdminUserGroup => "string",
299 CgiAdminUsers => "string",
303 values => [qw(de en es fr it nl pt_br)],
305 CgiUserHomePageCheck => "string",
306 CgiUserUrlCreate => "string",
307 CgiDateFormatMMDD => "boolean",
308 CgiNavBarAdminAllHosts => "boolean",
309 CgiSearchBoxEnable => "boolean",
318 lname => {type => "string", undefIfEmpty => 1},
319 name => {type => "string", undefIfEmpty => 1},
323 CgiStatusHilightColor => {
327 Reason_backup_failed => "string",
328 Reason_backup_done => "string",
329 Reason_no_ping => "string",
330 Reason_backup_canceled_by_user => "string",
331 Status_backup_in_progress => "string",
334 CgiHeaders => "bigstring",
335 CgiImageDir => "string",
336 CgiExt2ContentType => {
339 childType => "string",
341 CgiImageDirURL => "string",
342 CgiCSSFile => "string",
343 CgiUserConfigEditEnable => "boolean",
344 CgiUserConfigEdit => {
348 FullPeriod => "boolean",
349 IncrPeriod => "boolean",
350 FullKeepCnt => "boolean",
351 FullKeepCntMin => "boolean",
352 FullAgeMax => "boolean",
353 IncrKeepCnt => "boolean",
354 IncrKeepCntMin => "boolean",
355 IncrAgeMax => "boolean",
356 PartialAgeMax => "boolean",
357 IncrFill => "boolean",
358 RestoreInfoKeepCnt => "boolean",
359 ArchiveInfoKeepCnt => "boolean",
360 BackupFilesOnly => "boolean",
361 BackupFilesExclude => "boolean",
362 BlackoutBadPingLimit => "boolean",
363 BlackoutGoodCnt => "boolean",
364 BlackoutPeriods => "boolean",
365 BackupZeroFilesIsFatal => "boolean",
366 XferMethod => "boolean",
367 XferLogLevel => "boolean",
368 ClientCharset => "boolean",
369 SmbShareName => "boolean",
370 SmbShareUserName => "boolean",
371 SmbSharePasswd => "boolean",
372 SmbClientFullCmd => "boolean",
373 SmbClientIncrCmd => "boolean",
374 SmbClientRestoreCmd => "boolean",
375 TarShareName => "boolean",
376 TarFullArgs => "boolean",
377 TarIncrArgs => "boolean",
378 TarClientCmd => "boolean",
379 TarClientRestoreCmd => "boolean",
380 RsyncShareName => "boolean",
381 RsyncdClientPort => "boolean",
382 RsyncdPasswd => "boolean",
383 RsyncdAuthRequired => "boolean",
384 RsyncCsumCacheVerifyProb => "boolean",
385 RsyncArgs => "boolean",
386 RsyncRestoreArgs => "boolean",
387 RsyncClientCmd => "boolean",
388 RsyncClientRestoreCmd => "boolean",
389 ArchiveDest => "boolean",
390 ArchiveComp => "boolean",
391 ArchivePar => "boolean",
392 ArchiveSplit => "boolean",
393 ArchiveClientCmd => "boolean",
394 FixedIPNetBiosNameCheck => "boolean",
395 PingMaxMsec => "boolean",
396 NmbLookupCmd => "boolean",
397 NmbLookupFindHostCmd => "boolean",
398 PingCmd => "boolean",
399 ClientTimeout => "boolean",
400 MaxOldPerPCLogFiles => "boolean",
401 CompressLevel => "boolean",
402 ClientNameAlias => "boolean",
403 DumpPreUserCmd => "boolean",
404 DumpPostUserCmd => "boolean",
405 RestorePreUserCmd => "boolean",
406 RestorePostUserCmd => "boolean",
407 ArchivePreUserCmd => "boolean",
408 ArchivePostUserCmd => "boolean",
409 DumpPostShareCmd => "boolean",
410 DumpPreShareCmd => "boolean",
411 EMailNotifyMinDays => "boolean",
412 EMailFromUserName => "boolean",
413 EMailAdminUserName => "boolean",
414 EMailUserDestDomain => "boolean",
415 EMailNoBackupEverSubj => "boolean",
416 EMailNoBackupEverMesg => "boolean",
417 EMailNotifyOldBackupDays => "boolean",
418 EMailNoBackupRecentSubj => "boolean",
419 EMailNoBackupRecentMesg => "boolean",
420 EMailNotifyOldOutlookDays => "boolean",
421 EMailOutlookBackupSubj => "boolean",
422 EMailOutlookBackupMesg => "boolean",
426 ######################################################################
427 # Fake config setting for editing the hosts
428 ######################################################################
434 order => [qw(host dhcp user moreUsers)],
437 host => { type => "string", size => 20 },
438 dhcp => { type => "boolean" },
439 user => { type => "string", size => 20 },
440 moreUsers => { type => "string", size => 30 },