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.2.0, released 31 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",
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",
260 RsyncRestoreArgs => {
267 ######################################################################
269 ######################################################################
274 FtpUserName => "string",
275 FtpPasswd => "string",
276 FtpBlockSize => "integer",
277 FtpPort => "integer",
278 FtpTimeout => "integer",
279 FtpFollowSymlinks => "boolean",
281 ######################################################################
282 # Archive Configuration
283 ######################################################################
284 ArchiveDest => "string",
287 values => [qw(none bzip2 gzip)],
289 ArchivePar => "boolean",
290 ArchiveSplit => "float",
291 ArchiveClientCmd => "string",
293 ######################################################################
294 # Other Client Configuration
295 ######################################################################
296 NmbLookupCmd => "string",
297 NmbLookupFindHostCmd => "string",
299 FixedIPNetBiosNameCheck => "boolean",
301 PingMaxMsec => "float",
303 ClientTimeout => "integer",
305 MaxOldPerPCLogFiles => "integer",
307 CompressLevel => "integer",
309 DumpPreUserCmd => {type => "string", undefIfEmpty => 1},
310 DumpPostUserCmd => {type => "string", undefIfEmpty => 1},
311 DumpPreShareCmd => {type => "string", undefIfEmpty => 1},
312 DumpPostShareCmd => {type => "string", undefIfEmpty => 1},
313 RestorePreUserCmd => {type => "string", undefIfEmpty => 1},
314 RestorePostUserCmd => {type => "string", undefIfEmpty => 1},
315 ArchivePreUserCmd => {type => "string", undefIfEmpty => 1},
316 ArchivePostUserCmd => {type => "string", undefIfEmpty => 1},
317 UserCmdCheckStatus => "boolean",
319 ClientNameAlias => {type => "string", undefIfEmpty => 1},
321 ######################################################################
322 # Email reminders, status and messages
323 # (can be overridden in the per-PC config.pl)
324 ######################################################################
325 SendmailPath => {type => "execPath", undefIfEmpty => 1},
326 EMailNotifyMinDays => "float",
327 EMailFromUserName => "string",
328 EMailAdminUserName => "string",
329 EMailUserDestDomain => "string",
330 EMailNoBackupEverSubj => {type => "string", undefIfEmpty => 1},
331 EMailNoBackupEverMesg => {type => "bigstring", undefIfEmpty => 1},
332 EMailNotifyOldBackupDays => "float",
333 EMailNoBackupRecentSubj => {type => "string", undefIfEmpty => 1},
334 EMailNoBackupRecentMesg => {type => "bigstring", undefIfEmpty => 1},
335 EMailNotifyOldOutlookDays => "float",
336 EMailOutlookBackupSubj => {type => "string", undefIfEmpty => 1},
337 EMailOutlookBackupMesg => {type => "bigstring", undefIfEmpty => 1},
338 EMailHeaders => {type => "bigstring", undefIfEmpty => 1},
340 ######################################################################
341 # CGI user interface configuration settings
342 ######################################################################
343 CgiAdminUserGroup => "string",
344 CgiAdminUsers => "string",
348 values => [qw(de en es fr it nl pl pt_br zh_CN)],
350 CgiUserHomePageCheck => "string",
351 CgiUserUrlCreate => "string",
352 CgiDateFormatMMDD => "integer",
353 CgiNavBarAdminAllHosts => "boolean",
354 CgiSearchBoxEnable => "boolean",
363 lname => {type => "string", undefIfEmpty => 1},
364 name => {type => "string", undefIfEmpty => 1},
368 CgiStatusHilightColor => {
372 Reason_backup_failed => "string",
373 Reason_backup_done => "string",
374 Reason_no_ping => "string",
375 Reason_backup_canceled_by_user => "string",
376 Status_backup_in_progress => "string",
377 Disabled_OnlyManualBackups => "string",
378 Disabled_AllBackupsDisabled => "string",
381 CgiHeaders => "bigstring",
382 CgiImageDir => "string",
383 CgiExt2ContentType => {
386 childType => "string",
388 CgiImageDirURL => "string",
389 CgiCSSFile => "string",
390 CgiUserConfigEditEnable => "boolean",
391 CgiUserConfigEdit => {
395 FullPeriod => "boolean",
396 IncrPeriod => "boolean",
397 FullKeepCnt => "boolean",
398 FullKeepCntMin => "boolean",
399 FullAgeMax => "boolean",
400 IncrKeepCnt => "boolean",
401 IncrKeepCntMin => "boolean",
402 IncrAgeMax => "boolean",
403 IncrLevels => "boolean",
404 PartialAgeMax => "boolean",
405 IncrFill => "boolean",
406 RestoreInfoKeepCnt => "boolean",
407 ArchiveInfoKeepCnt => "boolean",
408 BackupFilesOnly => "boolean",
409 BackupFilesExclude => "boolean",
410 BackupsDisable => "boolean",
411 BlackoutBadPingLimit => "boolean",
412 BlackoutGoodCnt => "boolean",
413 BlackoutPeriods => "boolean",
414 BackupZeroFilesIsFatal => "boolean",
415 XferMethod => "boolean",
416 XferLogLevel => "boolean",
417 ClientCharset => "boolean",
418 ClientCharsetLegacy => "boolean",
419 SmbShareName => "boolean",
420 SmbShareUserName => "boolean",
421 SmbSharePasswd => "boolean",
422 SmbClientFullCmd => "boolean",
423 SmbClientIncrCmd => "boolean",
424 SmbClientRestoreCmd => "boolean",
425 TarShareName => "boolean",
426 TarFullArgs => "boolean",
427 TarIncrArgs => "boolean",
428 TarClientCmd => "boolean",
429 TarClientPath => "boolean",
430 TarClientRestoreCmd => "boolean",
431 RsyncShareName => "boolean",
432 RsyncdClientPort => "boolean",
433 RsyncdUserName => "boolean",
434 RsyncdPasswd => "boolean",
435 RsyncdAuthRequired => "boolean",
436 RsyncCsumCacheVerifyProb => "boolean",
437 RsyncArgs => "boolean",
438 RsyncRestoreArgs => "boolean",
439 RsyncClientCmd => "boolean",
440 RsyncClientPath => "boolean",
441 RsyncClientRestoreCmd => "boolean",
442 FtpShareName => "boolean",
443 FtpUserName => "boolean",
444 FtpPasswd => "boolean",
445 FtpBlockSize => "boolean",
446 FtpPort => "boolean",
447 FtpTimeout => "boolean",
448 ArchiveDest => "boolean",
449 ArchiveComp => "boolean",
450 ArchivePar => "boolean",
451 ArchiveSplit => "boolean",
452 ArchiveClientCmd => "boolean",
453 FixedIPNetBiosNameCheck => "boolean",
454 PingMaxMsec => "boolean",
455 NmbLookupCmd => "boolean",
456 NmbLookupFindHostCmd => "boolean",
457 PingCmd => "boolean",
458 ClientTimeout => "boolean",
459 MaxOldPerPCLogFiles => "boolean",
460 CompressLevel => "boolean",
461 ClientNameAlias => "boolean",
462 DumpPreUserCmd => "boolean",
463 DumpPostUserCmd => "boolean",
464 RestorePreUserCmd => "boolean",
465 RestorePostUserCmd => "boolean",
466 ArchivePreUserCmd => "boolean",
467 ArchivePostUserCmd => "boolean",
468 DumpPostShareCmd => "boolean",
469 DumpPreShareCmd => "boolean",
470 UserCmdCheckStatus => "boolean",
471 EMailNotifyMinDays => "boolean",
472 EMailFromUserName => "boolean",
473 EMailAdminUserName => "boolean",
474 EMailUserDestDomain => "boolean",
475 EMailNoBackupEverSubj => "boolean",
476 EMailNoBackupEverMesg => "boolean",
477 EMailNotifyOldBackupDays => "boolean",
478 EMailNoBackupRecentSubj => "boolean",
479 EMailNoBackupRecentMesg => "boolean",
480 EMailNotifyOldOutlookDays => "boolean",
481 EMailOutlookBackupSubj => "boolean",
482 EMailOutlookBackupMesg => "boolean",
483 EMailHeaders => "boolean",
487 ######################################################################
488 # Fake config setting for editing the hosts
489 ######################################################################
495 order => [qw(host dhcp user moreUsers)],
498 host => { type => "string", size => 20 },
499 dhcp => { type => "boolean" },
500 user => { type => "string", size => 20 },
501 moreUsers => { type => "string", size => 30 },