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-2009 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.2.0, released 31 Jul 2010.
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",
83 CmdQueueNice => "integer",
85 SshPath => {type => "execPath", undefIfEmpty => 1},
86 NmbLookupPath => {type => "execPath", undefIfEmpty => 1},
87 PingPath => {type => "execPath", undefIfEmpty => 1},
88 DfPath => {type => "execPath", undefIfEmpty => 1},
90 SplitPath => {type => "execPath", undefIfEmpty => 1},
91 ParPath => {type => "execPath", undefIfEmpty => 1},
92 CatPath => {type => "execPath", undefIfEmpty => 1},
93 GzipPath => {type => "execPath", undefIfEmpty => 1},
94 Bzip2Path => {type => "execPath", undefIfEmpty => 1},
95 DfMaxUsagePct => "float",
96 TrashCleanSleepSec => "integer",
97 DHCPAddressRanges => {
103 order => [qw(ipAddrBase first last)],
105 ipAddrBase => "string",
111 BackupPCUser => "string",
113 InstallDir => "string",
117 BackupPCUserVerify => "boolean",
118 HardLinkMax => "integer",
125 ServerInitdPath => {type => "string", undefIfEmpty => 1},
126 ServerInitdStartCmd => "string",
128 ######################################################################
129 # What to backup and when to do it
130 # (can be overridden in the per-PC config.pl)
131 ######################################################################
132 FullPeriod => "float",
133 IncrPeriod => "float",
138 FullKeepCntMin => "integer",
139 FullAgeMax => "float",
140 IncrKeepCnt => "integer",
141 IncrKeepCntMin => "integer",
142 IncrAgeMax => "float",
147 PartialAgeMax => "float",
148 BackupsDisable => "integer",
149 IncrFill => "boolean",
150 RestoreInfoKeepCnt => "integer",
151 ArchiveInfoKeepCnt => "integer",
162 BackupFilesExclude => {
172 BlackoutBadPingLimit => "integer",
173 BlackoutGoodCnt => "integer",
181 hourBegin => "float",
191 BackupZeroFilesIsFatal => "boolean",
193 ######################################################################
194 # How to backup a client
195 ######################################################################
198 values => [qw(archive ftp rsync rsyncd smb tar)],
200 XferLogLevel => "integer",
202 ClientCharset => "string",
203 ClientCharsetLegacy => "string",
205 ######################################################################
207 ######################################################################
212 SmbShareUserName => "string",
213 SmbSharePasswd => "string",
214 SmbClientPath => {type => "execPath", undefIfEmpty => 1},
215 SmbClientFullCmd => "string",
216 SmbClientIncrCmd => "string",
217 SmbClientRestoreCmd => {type => "string", undefIfEmpty => 1},
219 ######################################################################
221 ######################################################################
226 TarClientCmd => "string",
227 TarFullArgs => "string",
228 TarIncrArgs => "string",
229 TarClientRestoreCmd => {type => "string", undefIfEmpty => 1},
230 TarClientPath => {type => "string", undefIfEmpty => 1},
232 ######################################################################
233 # Rsync Configuration
234 ######################################################################
239 RsyncClientPath => {type => "string", undefIfEmpty => 1},
240 RsyncClientCmd => "string",
241 RsyncClientRestoreCmd => "string",
243 ######################################################################
244 # Rsyncd Configuration
245 ######################################################################
246 RsyncdClientPort => "integer",
247 RsyncdUserName => "string",
248 RsyncdPasswd => "string",
249 RsyncdAuthRequired => "boolean",
251 ######################################################################
253 ######################################################################
254 RsyncCsumCacheVerifyProb => "float",
265 RsyncRestoreArgs => {
272 ######################################################################
274 ######################################################################
279 FtpUserName => "string",
280 FtpPasswd => "string",
281 FtpPassive => "boolean",
282 FtpBlockSize => "integer",
283 FtpPort => "integer",
284 FtpTimeout => "integer",
285 FtpFollowSymlinks => "boolean",
287 ######################################################################
288 # Archive Configuration
289 ######################################################################
290 ArchiveDest => "string",
293 values => [qw(none bzip2 gzip)],
295 ArchivePar => "boolean",
296 ArchiveSplit => "float",
297 ArchiveClientCmd => "string",
299 ######################################################################
300 # Other Client Configuration
301 ######################################################################
302 NmbLookupCmd => "string",
303 NmbLookupFindHostCmd => "string",
305 FixedIPNetBiosNameCheck => "boolean",
307 PingMaxMsec => "float",
309 ClientTimeout => "integer",
311 MaxOldPerPCLogFiles => "integer",
313 CompressLevel => "integer",
315 DumpPreUserCmd => {type => "string", undefIfEmpty => 1},
316 DumpPostUserCmd => {type => "string", undefIfEmpty => 1},
317 DumpPreShareCmd => {type => "string", undefIfEmpty => 1},
318 DumpPostShareCmd => {type => "string", undefIfEmpty => 1},
319 RestorePreUserCmd => {type => "string", undefIfEmpty => 1},
320 RestorePostUserCmd => {type => "string", undefIfEmpty => 1},
321 ArchivePreUserCmd => {type => "string", undefIfEmpty => 1},
322 ArchivePostUserCmd => {type => "string", undefIfEmpty => 1},
323 UserCmdCheckStatus => "boolean",
325 ClientNameAlias => {type => "string", undefIfEmpty => 1},
327 ######################################################################
328 # Email reminders, status and messages
329 # (can be overridden in the per-PC config.pl)
330 ######################################################################
331 SendmailPath => {type => "execPath", undefIfEmpty => 1},
332 EMailNotifyMinDays => "float",
333 EMailFromUserName => "string",
334 EMailAdminUserName => "string",
335 EMailUserDestDomain => "string",
336 EMailNoBackupEverSubj => {type => "string", undefIfEmpty => 1},
337 EMailNoBackupEverMesg => {type => "bigstring", undefIfEmpty => 1},
338 EMailNotifyOldBackupDays => "float",
339 EMailNoBackupRecentSubj => {type => "string", undefIfEmpty => 1},
340 EMailNoBackupRecentMesg => {type => "bigstring", undefIfEmpty => 1},
341 EMailNotifyOldOutlookDays => "float",
342 EMailOutlookBackupSubj => {type => "string", undefIfEmpty => 1},
343 EMailOutlookBackupMesg => {type => "bigstring", undefIfEmpty => 1},
344 EMailHeaders => {type => "bigstring", undefIfEmpty => 1},
346 ######################################################################
347 # CGI user interface configuration settings
348 ######################################################################
349 CgiAdminUserGroup => "string",
350 CgiAdminUsers => "string",
354 values => [qw(cz de en es fr it nl pl pt_br zh_CN)],
356 CgiUserHomePageCheck => "string",
357 CgiUserUrlCreate => "string",
358 CgiDateFormatMMDD => "integer",
359 CgiNavBarAdminAllHosts => "boolean",
360 CgiSearchBoxEnable => "boolean",
369 lname => {type => "string", undefIfEmpty => 1},
370 name => {type => "string", undefIfEmpty => 1},
374 CgiStatusHilightColor => {
378 Reason_backup_failed => "string",
379 Reason_backup_done => "string",
380 Reason_no_ping => "string",
381 Reason_backup_canceled_by_user => "string",
382 Status_backup_in_progress => "string",
383 Disabled_OnlyManualBackups => "string",
384 Disabled_AllBackupsDisabled => "string",
387 CgiHeaders => "bigstring",
388 CgiImageDir => "string",
389 CgiExt2ContentType => {
392 childType => "string",
394 CgiImageDirURL => "string",
395 CgiCSSFile => "string",
396 CgiUserConfigEditEnable => "boolean",
397 CgiUserConfigEdit => {
401 FullPeriod => "boolean",
402 IncrPeriod => "boolean",
403 FullKeepCnt => "boolean",
404 FullKeepCntMin => "boolean",
405 FullAgeMax => "boolean",
406 IncrKeepCnt => "boolean",
407 IncrKeepCntMin => "boolean",
408 IncrAgeMax => "boolean",
409 IncrLevels => "boolean",
410 PartialAgeMax => "boolean",
411 IncrFill => "boolean",
412 RestoreInfoKeepCnt => "boolean",
413 ArchiveInfoKeepCnt => "boolean",
414 BackupFilesOnly => "boolean",
415 BackupFilesExclude => "boolean",
416 BackupsDisable => "boolean",
417 BlackoutBadPingLimit => "boolean",
418 BlackoutGoodCnt => "boolean",
419 BlackoutPeriods => "boolean",
420 BackupZeroFilesIsFatal => "boolean",
421 XferMethod => "boolean",
422 XferLogLevel => "boolean",
423 ClientCharset => "boolean",
424 ClientCharsetLegacy => "boolean",
425 SmbShareName => "boolean",
426 SmbShareUserName => "boolean",
427 SmbSharePasswd => "boolean",
428 SmbClientFullCmd => "boolean",
429 SmbClientIncrCmd => "boolean",
430 SmbClientRestoreCmd => "boolean",
431 TarShareName => "boolean",
432 TarFullArgs => "boolean",
433 TarIncrArgs => "boolean",
434 TarClientCmd => "boolean",
435 TarClientPath => "boolean",
436 TarClientRestoreCmd => "boolean",
437 RsyncShareName => "boolean",
438 RsyncdClientPort => "boolean",
439 RsyncdUserName => "boolean",
440 RsyncdPasswd => "boolean",
441 RsyncdAuthRequired => "boolean",
442 RsyncCsumCacheVerifyProb => "boolean",
443 RsyncArgs => "boolean",
444 RsyncArgsExtra => "boolean",
445 RsyncRestoreArgs => "boolean",
446 RsyncClientCmd => "boolean",
447 RsyncClientPath => "boolean",
448 RsyncClientRestoreCmd => "boolean",
449 FtpShareName => "boolean",
450 FtpUserName => "boolean",
451 FtpPasswd => "boolean",
452 FtpBlockSize => "boolean",
453 FtpPort => "boolean",
454 FtpTimeout => "boolean",
455 FtpFollowSymlinks => "boolean",
456 FtpRestoreEnabled => "boolean",
457 ArchiveDest => "boolean",
458 ArchiveComp => "boolean",
459 ArchivePar => "boolean",
460 ArchiveSplit => "boolean",
461 ArchiveClientCmd => "boolean",
462 FixedIPNetBiosNameCheck => "boolean",
463 PingMaxMsec => "boolean",
464 NmbLookupCmd => "boolean",
465 NmbLookupFindHostCmd => "boolean",
466 PingCmd => "boolean",
467 ClientTimeout => "boolean",
468 MaxOldPerPCLogFiles => "boolean",
469 CompressLevel => "boolean",
470 ClientNameAlias => "boolean",
471 DumpPreUserCmd => "boolean",
472 DumpPostUserCmd => "boolean",
473 RestorePreUserCmd => "boolean",
474 RestorePostUserCmd => "boolean",
475 ArchivePreUserCmd => "boolean",
476 ArchivePostUserCmd => "boolean",
477 DumpPostShareCmd => "boolean",
478 DumpPreShareCmd => "boolean",
479 UserCmdCheckStatus => "boolean",
480 EMailNotifyMinDays => "boolean",
481 EMailFromUserName => "boolean",
482 EMailAdminUserName => "boolean",
483 EMailUserDestDomain => "boolean",
484 EMailNoBackupEverSubj => "boolean",
485 EMailNoBackupEverMesg => "boolean",
486 EMailNotifyOldBackupDays => "boolean",
487 EMailNoBackupRecentSubj => "boolean",
488 EMailNoBackupRecentMesg => "boolean",
489 EMailNotifyOldOutlookDays => "boolean",
490 EMailOutlookBackupSubj => "boolean",
491 EMailOutlookBackupMesg => "boolean",
492 EMailHeaders => "boolean",
496 ######################################################################
497 # Fake config setting for editing the hosts
498 ######################################################################
504 order => [qw(host dhcp user moreUsers)],
507 host => { type => "string", size => 20 },
508 dhcp => { type => "boolean" },
509 user => { type => "string", size => 20 },
510 moreUsers => { type => "string", size => 30 },