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-2007 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.1.1, released 22 Dec 2008.
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",
146 PartialAgeMax => "float",
147 BackupsDisable => "integer",
148 IncrFill => "boolean",
149 RestoreInfoKeepCnt => "integer",
150 ArchiveInfoKeepCnt => "integer",
161 BackupFilesExclude => {
171 BlackoutBadPingLimit => "integer",
172 BlackoutGoodCnt => "integer",
180 hourBegin => "float",
190 BackupZeroFilesIsFatal => "boolean",
192 ######################################################################
193 # How to backup a client
194 ######################################################################
197 values => [qw(archive ftp rsync rsyncd smb tar)],
199 XferLogLevel => "integer",
201 ClientCharset => "string",
202 ClientCharsetLegacy => "string",
204 ######################################################################
206 ######################################################################
211 SmbShareUserName => "string",
212 SmbSharePasswd => "string",
213 SmbClientPath => {type => "execPath", undefIfEmpty => 1},
214 SmbClientFullCmd => "string",
215 SmbClientIncrCmd => "string",
216 SmbClientRestoreCmd => {type => "string", undefIfEmpty => 1},
218 ######################################################################
220 ######################################################################
225 TarClientCmd => "string",
226 TarFullArgs => "string",
227 TarIncrArgs => "string",
228 TarClientRestoreCmd => {type => "string", undefIfEmpty => 1},
229 TarClientPath => {type => "string", undefIfEmpty => 1},
231 ######################################################################
232 # Rsync Configuration
233 ######################################################################
238 RsyncClientPath => {type => "string", undefIfEmpty => 1},
239 RsyncClientCmd => "string",
240 RsyncClientRestoreCmd => "string",
242 ######################################################################
243 # Rsyncd Configuration
244 ######################################################################
245 RsyncdClientPort => "integer",
246 RsyncdUserName => "string",
247 RsyncdPasswd => "string",
248 RsyncdAuthRequired => "boolean",
250 ######################################################################
252 ######################################################################
253 RsyncCsumCacheVerifyProb => "float",
259 RsyncRestoreArgs => {
266 ######################################################################
268 ######################################################################
273 FtpUserName => "string",
274 FtpPasswd => "string",
275 FtpBlockSize => "integer",
276 FtpPort => "integer",
277 FtpTimeout => "integer",
278 FtpFollowSymlinks => "boolean",
280 ######################################################################
281 # BackupPCd Configuration
282 ######################################################################
283 BackupPCdShareName => {
287 BackupPCdCmd => "string",
288 BackupPCdPath => "string",
289 BackupPCdRestoreCmd => "string",
291 ######################################################################
292 # Archive Configuration
293 ######################################################################
294 ArchiveDest => "string",
297 values => [qw(none bzip2 gzip)],
299 ArchivePar => "boolean",
300 ArchiveSplit => "float",
301 ArchiveClientCmd => "string",
303 ######################################################################
304 # Other Client Configuration
305 ######################################################################
306 NmbLookupCmd => "string",
307 NmbLookupFindHostCmd => "string",
309 FixedIPNetBiosNameCheck => "boolean",
311 PingMaxMsec => "float",
313 ClientTimeout => "integer",
315 MaxOldPerPCLogFiles => "integer",
317 CompressLevel => "integer",
319 DumpPreUserCmd => {type => "string", undefIfEmpty => 1},
320 DumpPostUserCmd => {type => "string", undefIfEmpty => 1},
321 DumpPreShareCmd => {type => "string", undefIfEmpty => 1},
322 DumpPostShareCmd => {type => "string", undefIfEmpty => 1},
323 RestorePreUserCmd => {type => "string", undefIfEmpty => 1},
324 RestorePostUserCmd => {type => "string", undefIfEmpty => 1},
325 ArchivePreUserCmd => {type => "string", undefIfEmpty => 1},
326 ArchivePostUserCmd => {type => "string", undefIfEmpty => 1},
327 UserCmdCheckStatus => "boolean",
329 ClientNameAlias => {type => "string", undefIfEmpty => 1},
331 ######################################################################
332 # Email reminders, status and messages
333 # (can be overridden in the per-PC config.pl)
334 ######################################################################
335 SendmailPath => {type => "execPath", undefIfEmpty => 1},
336 EMailNotifyMinDays => "float",
337 EMailFromUserName => "string",
338 EMailAdminUserName => "string",
339 EMailUserDestDomain => "string",
340 EMailNoBackupEverSubj => {type => "string", undefIfEmpty => 1},
341 EMailNoBackupEverMesg => {type => "bigstring", undefIfEmpty => 1},
342 EMailNotifyOldBackupDays => "float",
343 EMailNoBackupRecentSubj => {type => "string", undefIfEmpty => 1},
344 EMailNoBackupRecentMesg => {type => "bigstring", undefIfEmpty => 1},
345 EMailNotifyOldOutlookDays => "float",
346 EMailOutlookBackupSubj => {type => "string", undefIfEmpty => 1},
347 EMailOutlookBackupMesg => {type => "bigstring", undefIfEmpty => 1},
348 EMailHeaders => {type => "bigstring", undefIfEmpty => 1},
350 ######################################################################
351 # CGI user interface configuration settings
352 ######################################################################
353 CgiAdminUserGroup => "string",
354 CgiAdminUsers => "string",
358 values => [qw(de en es fr it nl pl pt_br zh_CN)],
360 CgiUserHomePageCheck => "string",
361 CgiUserUrlCreate => "string",
362 CgiDateFormatMMDD => "integer",
363 CgiNavBarAdminAllHosts => "boolean",
364 CgiSearchBoxEnable => "boolean",
373 lname => {type => "string", undefIfEmpty => 1},
374 name => {type => "string", undefIfEmpty => 1},
378 CgiStatusHilightColor => {
382 Reason_backup_failed => "string",
383 Reason_backup_done => "string",
384 Reason_no_ping => "string",
385 Reason_backup_canceled_by_user => "string",
386 Status_backup_in_progress => "string",
387 Disabled_OnlyManualBackups => "string",
388 Disabled_AllBackupsDisabled => "string",
391 CgiHeaders => "bigstring",
392 CgiImageDir => "string",
393 CgiExt2ContentType => {
396 childType => "string",
398 CgiImageDirURL => "string",
399 CgiCSSFile => "string",
400 CgiUserConfigEditEnable => "boolean",
401 CgiUserConfigEdit => {
405 FullPeriod => "boolean",
406 IncrPeriod => "boolean",
407 FullKeepCnt => "boolean",
408 FullKeepCntMin => "boolean",
409 FullAgeMax => "boolean",
410 IncrKeepCnt => "boolean",
411 IncrKeepCntMin => "boolean",
412 IncrAgeMax => "boolean",
413 IncrLevels => "boolean",
414 PartialAgeMax => "boolean",
415 IncrFill => "boolean",
416 RestoreInfoKeepCnt => "boolean",
417 ArchiveInfoKeepCnt => "boolean",
418 BackupFilesOnly => "boolean",
419 BackupFilesExclude => "boolean",
420 BackupsDisable => "boolean",
421 BlackoutBadPingLimit => "boolean",
422 BlackoutGoodCnt => "boolean",
423 BlackoutPeriods => "boolean",
424 BackupZeroFilesIsFatal => "boolean",
425 XferMethod => "boolean",
426 XferLogLevel => "boolean",
427 ClientCharset => "boolean",
428 ClientCharsetLegacy => "boolean",
429 SmbShareName => "boolean",
430 SmbShareUserName => "boolean",
431 SmbSharePasswd => "boolean",
432 SmbClientFullCmd => "boolean",
433 SmbClientIncrCmd => "boolean",
434 SmbClientRestoreCmd => "boolean",
435 TarShareName => "boolean",
436 TarFullArgs => "boolean",
437 TarIncrArgs => "boolean",
438 TarClientCmd => "boolean",
439 TarClientPath => "boolean",
440 TarClientRestoreCmd => "boolean",
441 RsyncShareName => "boolean",
442 RsyncdClientPort => "boolean",
443 RsyncdUserName => "boolean",
444 RsyncdPasswd => "boolean",
445 RsyncdAuthRequired => "boolean",
446 RsyncCsumCacheVerifyProb => "boolean",
447 RsyncArgs => "boolean",
448 RsyncRestoreArgs => "boolean",
449 RsyncClientCmd => "boolean",
450 RsyncClientPath => "boolean",
451 RsyncClientRestoreCmd => "boolean",
452 FtpShareName => "boolean",
453 FtpUserName => "boolean",
454 FtpPasswd => "boolean",
455 FtpBlockSize => "boolean",
456 FtpPort => "boolean",
457 FtpTimeout => "boolean",
458 BackupPCdShareName => "boolean",
459 BackupPCdCmd => "boolean",
460 BackupPCdPath => "boolean",
461 BackupPCdRestoreCmd => "boolean",
462 ArchiveDest => "boolean",
463 ArchiveComp => "boolean",
464 ArchivePar => "boolean",
465 ArchiveSplit => "boolean",
466 ArchiveClientCmd => "boolean",
467 FixedIPNetBiosNameCheck => "boolean",
468 PingMaxMsec => "boolean",
469 NmbLookupCmd => "boolean",
470 NmbLookupFindHostCmd => "boolean",
471 PingCmd => "boolean",
472 ClientTimeout => "boolean",
473 MaxOldPerPCLogFiles => "boolean",
474 CompressLevel => "boolean",
475 ClientNameAlias => "boolean",
476 DumpPreUserCmd => "boolean",
477 DumpPostUserCmd => "boolean",
478 RestorePreUserCmd => "boolean",
479 RestorePostUserCmd => "boolean",
480 ArchivePreUserCmd => "boolean",
481 ArchivePostUserCmd => "boolean",
482 DumpPostShareCmd => "boolean",
483 DumpPreShareCmd => "boolean",
484 UserCmdCheckStatus => "boolean",
485 EMailNotifyMinDays => "boolean",
486 EMailFromUserName => "boolean",
487 EMailAdminUserName => "boolean",
488 EMailUserDestDomain => "boolean",
489 EMailNoBackupEverSubj => "boolean",
490 EMailNoBackupEverMesg => "boolean",
491 EMailNotifyOldBackupDays => "boolean",
492 EMailNoBackupRecentSubj => "boolean",
493 EMailNoBackupRecentMesg => "boolean",
494 EMailNotifyOldOutlookDays => "boolean",
495 EMailOutlookBackupSubj => "boolean",
496 EMailOutlookBackupMesg => "boolean",
497 EMailHeaders => "boolean",
501 ######################################################################
502 # Fake config setting for editing the hosts
503 ######################################################################
509 order => [qw(host dhcp user moreUsers)],
512 host => { type => "string", size => 20 },
513 dhcp => { type => "boolean" },
514 user => { type => "string", size => 20 },
515 moreUsers => { type => "string", size => 30 },