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.1.0beta0, released 3 Sep 2007.
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 rsync rsyncd smb tar)],
199 XferLogLevel => "integer",
201 ClientCharset => "string",
202 ClientCharsetLegacy => "string",
208 SmbShareUserName => "string",
209 SmbSharePasswd => "string",
210 SmbClientPath => {type => "execPath", undefIfEmpty => 1},
211 SmbClientFullCmd => "string",
212 SmbClientIncrCmd => "string",
213 SmbClientRestoreCmd => "string",
219 TarClientCmd => "string",
220 TarFullArgs => "string",
221 TarIncrArgs => "string",
222 TarClientRestoreCmd => "string",
223 TarClientPath => {type => "string", undefIfEmpty => 1},
229 RsyncClientPath => {type => "string", undefIfEmpty => 1},
230 RsyncClientCmd => "string",
231 RsyncClientRestoreCmd => "string",
233 RsyncdClientPort => "integer",
234 RsyncdUserName => "string",
235 RsyncdPasswd => "string",
236 RsyncdAuthRequired => "boolean",
238 RsyncCsumCacheVerifyProb => "float",
244 RsyncRestoreArgs => {
250 BackupPCdCmd => "string",
251 BackupPCdPath => "string",
252 BackupPCdShareName => "string",
253 BackupPCdRestoreCmd => "string",
255 ArchiveDest => "string",
258 values => [qw(none bzip2 gzip)],
260 ArchivePar => "boolean",
261 ArchiveSplit => "float",
262 ArchiveClientCmd => "string",
264 NmbLookupCmd => "string",
265 NmbLookupFindHostCmd => "string",
267 FixedIPNetBiosNameCheck => "boolean",
269 PingMaxMsec => "float",
271 ClientTimeout => "integer",
273 MaxOldPerPCLogFiles => "integer",
275 CompressLevel => "integer",
277 DumpPreUserCmd => {type => "string", undefIfEmpty => 1},
278 DumpPostUserCmd => {type => "string", undefIfEmpty => 1},
279 DumpPreShareCmd => {type => "string", undefIfEmpty => 1},
280 DumpPostShareCmd => {type => "string", undefIfEmpty => 1},
281 RestorePreUserCmd => {type => "string", undefIfEmpty => 1},
282 RestorePostUserCmd => {type => "string", undefIfEmpty => 1},
283 ArchivePreUserCmd => {type => "string", undefIfEmpty => 1},
284 ArchivePostUserCmd => {type => "string", undefIfEmpty => 1},
285 UserCmdCheckStatus => "boolean",
287 ClientNameAlias => {type => "string", undefIfEmpty => 1},
289 ######################################################################
290 # Email reminders, status and messages
291 # (can be overridden in the per-PC config.pl)
292 ######################################################################
293 SendmailPath => {type => "execPath", undefIfEmpty => 1},
294 EMailNotifyMinDays => "float",
295 EMailFromUserName => "string",
296 EMailAdminUserName => "string",
297 EMailUserDestDomain => "string",
298 EMailNoBackupEverSubj => {type => "string", undefIfEmpty => 1},
299 EMailNoBackupEverMesg => {type => "bigstring", undefIfEmpty => 1},
300 EMailNotifyOldBackupDays => "float",
301 EMailNoBackupRecentSubj => {type => "string", undefIfEmpty => 1},
302 EMailNoBackupRecentMesg => {type => "bigstring", undefIfEmpty => 1},
303 EMailNotifyOldOutlookDays => "float",
304 EMailOutlookBackupSubj => {type => "string", undefIfEmpty => 1},
305 EMailOutlookBackupMesg => {type => "bigstring", undefIfEmpty => 1},
306 EMailHeaders => {type => "bigstring", undefIfEmpty => 1},
308 ######################################################################
309 # CGI user interface configuration settings
310 ######################################################################
311 CgiAdminUserGroup => "string",
312 CgiAdminUsers => "string",
316 values => [qw(de en es fr it nl pt_br zh_CN)],
318 CgiUserHomePageCheck => "string",
319 CgiUserUrlCreate => "string",
320 CgiDateFormatMMDD => "integer",
321 CgiNavBarAdminAllHosts => "boolean",
322 CgiSearchBoxEnable => "boolean",
331 lname => {type => "string", undefIfEmpty => 1},
332 name => {type => "string", undefIfEmpty => 1},
336 CgiStatusHilightColor => {
340 Reason_backup_failed => "string",
341 Reason_backup_done => "string",
342 Reason_no_ping => "string",
343 Reason_backup_canceled_by_user => "string",
344 Status_backup_in_progress => "string",
345 Disabled_OnlyManualBackups => "string",
346 Disabled_AllBackupsDisabled => "string",
349 CgiHeaders => "bigstring",
350 CgiImageDir => "string",
351 CgiExt2ContentType => {
354 childType => "string",
356 CgiImageDirURL => "string",
357 CgiCSSFile => "string",
358 CgiUserConfigEditEnable => "boolean",
359 CgiUserConfigEdit => {
363 FullPeriod => "boolean",
364 IncrPeriod => "boolean",
365 FullKeepCnt => "boolean",
366 FullKeepCntMin => "boolean",
367 FullAgeMax => "boolean",
368 IncrKeepCnt => "boolean",
369 IncrKeepCntMin => "boolean",
370 IncrAgeMax => "boolean",
371 IncrLevels => "boolean",
372 PartialAgeMax => "boolean",
373 IncrFill => "boolean",
374 RestoreInfoKeepCnt => "boolean",
375 ArchiveInfoKeepCnt => "boolean",
376 BackupFilesOnly => "boolean",
377 BackupFilesExclude => "boolean",
378 BackupsDisable => "boolean",
379 BlackoutBadPingLimit => "boolean",
380 BlackoutGoodCnt => "boolean",
381 BlackoutPeriods => "boolean",
382 BackupZeroFilesIsFatal => "boolean",
383 XferMethod => "boolean",
384 XferLogLevel => "boolean",
385 ClientCharset => "boolean",
386 ClientCharsetLegacy => "boolean",
387 SmbShareName => "boolean",
388 SmbShareUserName => "boolean",
389 SmbSharePasswd => "boolean",
390 SmbClientFullCmd => "boolean",
391 SmbClientIncrCmd => "boolean",
392 SmbClientRestoreCmd => "boolean",
393 TarShareName => "boolean",
394 TarFullArgs => "boolean",
395 TarIncrArgs => "boolean",
396 TarClientCmd => "boolean",
397 TarClientPath => "boolean",
398 TarClientRestoreCmd => "boolean",
399 RsyncShareName => "boolean",
400 RsyncdClientPort => "boolean",
401 RsyncdUserName => "boolean",
402 RsyncdPasswd => "boolean",
403 RsyncdAuthRequired => "boolean",
404 RsyncCsumCacheVerifyProb => "boolean",
405 RsyncArgs => "boolean",
406 RsyncRestoreArgs => "boolean",
407 RsyncClientCmd => "boolean",
408 RsyncClientPath => "boolean",
409 RsyncClientRestoreCmd => "boolean",
410 ArchiveDest => "boolean",
411 ArchiveComp => "boolean",
412 ArchivePar => "boolean",
413 ArchiveSplit => "boolean",
414 ArchiveClientCmd => "boolean",
415 FixedIPNetBiosNameCheck => "boolean",
416 PingMaxMsec => "boolean",
417 NmbLookupCmd => "boolean",
418 NmbLookupFindHostCmd => "boolean",
419 PingCmd => "boolean",
420 ClientTimeout => "boolean",
421 MaxOldPerPCLogFiles => "boolean",
422 CompressLevel => "boolean",
423 ClientNameAlias => "boolean",
424 DumpPreUserCmd => "boolean",
425 DumpPostUserCmd => "boolean",
426 RestorePreUserCmd => "boolean",
427 RestorePostUserCmd => "boolean",
428 ArchivePreUserCmd => "boolean",
429 ArchivePostUserCmd => "boolean",
430 DumpPostShareCmd => "boolean",
431 DumpPreShareCmd => "boolean",
432 UserCmdCheckStatus => "boolean",
433 EMailNotifyMinDays => "boolean",
434 EMailFromUserName => "boolean",
435 EMailAdminUserName => "boolean",
436 EMailUserDestDomain => "boolean",
437 EMailNoBackupEverSubj => "boolean",
438 EMailNoBackupEverMesg => "boolean",
439 EMailNotifyOldBackupDays => "boolean",
440 EMailNoBackupRecentSubj => "boolean",
441 EMailNoBackupRecentMesg => "boolean",
442 EMailNotifyOldOutlookDays => "boolean",
443 EMailOutlookBackupSubj => "boolean",
444 EMailOutlookBackupMesg => "boolean",
445 EMailHeaders => "boolean",
449 ######################################################################
450 # Fake config setting for editing the hosts
451 ######################################################################
457 order => [qw(host dhcp user moreUsers)],
460 host => { type => "string", size => 20 },
461 dhcp => { type => "boolean" },
462 user => { type => "string", size => 20 },
463 moreUsers => { type => "string", size => 30 },