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.0beta2, released 11 Nov 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",
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",
207 SmbShareUserName => "string",
208 SmbSharePasswd => "string",
209 SmbClientPath => {type => "execPath", undefIfEmpty => 1},
210 SmbClientFullCmd => "string",
211 SmbClientIncrCmd => "string",
212 SmbClientRestoreCmd => "string",
218 TarClientCmd => "string",
219 TarFullArgs => "string",
220 TarIncrArgs => "string",
221 TarClientRestoreCmd => "string",
222 TarClientPath => {type => "string", undefIfEmpty => 1},
228 RsyncClientPath => {type => "string", undefIfEmpty => 1},
229 RsyncClientCmd => "string",
230 RsyncClientRestoreCmd => "string",
232 RsyncdClientPort => "integer",
233 RsyncdUserName => "string",
234 RsyncdPasswd => "string",
235 RsyncdAuthRequired => "boolean",
237 RsyncCsumCacheVerifyProb => "float",
243 RsyncRestoreArgs => {
249 BackupPCdCmd => "string",
250 BackupPCdPath => "string",
251 BackupPCdShareName => "string",
252 BackupPCdRestoreCmd => "string",
254 ArchiveDest => "string",
257 values => [qw(none bzip2 gzip)],
259 ArchivePar => "boolean",
260 ArchiveSplit => "float",
261 ArchiveClientCmd => "string",
263 NmbLookupCmd => "string",
264 NmbLookupFindHostCmd => "string",
266 FixedIPNetBiosNameCheck => "boolean",
268 PingMaxMsec => "float",
270 ClientTimeout => "integer",
272 MaxOldPerPCLogFiles => "integer",
274 CompressLevel => "integer",
276 DumpPreUserCmd => {type => "string", undefIfEmpty => 1},
277 DumpPostUserCmd => {type => "string", undefIfEmpty => 1},
278 DumpPreShareCmd => {type => "string", undefIfEmpty => 1},
279 DumpPostShareCmd => {type => "string", undefIfEmpty => 1},
280 RestorePreUserCmd => {type => "string", undefIfEmpty => 1},
281 RestorePostUserCmd => {type => "string", undefIfEmpty => 1},
282 ArchivePreUserCmd => {type => "string", undefIfEmpty => 1},
283 ArchivePostUserCmd => {type => "string", undefIfEmpty => 1},
284 UserCmdCheckStatus => "boolean",
286 ClientNameAlias => {type => "string", undefIfEmpty => 1},
288 ######################################################################
289 # Email reminders, status and messages
290 # (can be overridden in the per-PC config.pl)
291 ######################################################################
292 SendmailPath => {type => "execPath", undefIfEmpty => 1},
293 EMailNotifyMinDays => "float",
294 EMailFromUserName => "string",
295 EMailAdminUserName => "string",
296 EMailUserDestDomain => "string",
297 EMailNoBackupEverSubj => {type => "string", undefIfEmpty => 1},
298 EMailNoBackupEverMesg => {type => "bigstring", undefIfEmpty => 1},
299 EMailNotifyOldBackupDays => "float",
300 EMailNoBackupRecentSubj => {type => "string", undefIfEmpty => 1},
301 EMailNoBackupRecentMesg => {type => "bigstring", undefIfEmpty => 1},
302 EMailNotifyOldOutlookDays => "float",
303 EMailOutlookBackupSubj => {type => "string", undefIfEmpty => 1},
304 EMailOutlookBackupMesg => {type => "bigstring", undefIfEmpty => 1},
305 EMailHeaders => {type => "bigstring", undefIfEmpty => 1},
307 ######################################################################
308 # CGI user interface configuration settings
309 ######################################################################
310 CgiAdminUserGroup => "string",
311 CgiAdminUsers => "string",
315 values => [qw(de en es fr it nl pt_br)],
317 CgiUserHomePageCheck => "string",
318 CgiUserUrlCreate => "string",
319 CgiDateFormatMMDD => "boolean",
320 CgiNavBarAdminAllHosts => "boolean",
321 CgiSearchBoxEnable => "boolean",
330 lname => {type => "string", undefIfEmpty => 1},
331 name => {type => "string", undefIfEmpty => 1},
335 CgiStatusHilightColor => {
339 Reason_backup_failed => "string",
340 Reason_backup_done => "string",
341 Reason_no_ping => "string",
342 Reason_backup_canceled_by_user => "string",
343 Status_backup_in_progress => "string",
344 Disabled_OnlyManualBackups => "string",
345 Disabled_AllBackupsDisabled => "string",
348 CgiHeaders => "bigstring",
349 CgiImageDir => "string",
350 CgiExt2ContentType => {
353 childType => "string",
355 CgiImageDirURL => "string",
356 CgiCSSFile => "string",
357 CgiUserConfigEditEnable => "boolean",
358 CgiUserConfigEdit => {
362 FullPeriod => "boolean",
363 IncrPeriod => "boolean",
364 FullKeepCnt => "boolean",
365 FullKeepCntMin => "boolean",
366 FullAgeMax => "boolean",
367 IncrKeepCnt => "boolean",
368 IncrKeepCntMin => "boolean",
369 IncrAgeMax => "boolean",
370 IncrLevels => "boolean",
371 PartialAgeMax => "boolean",
372 IncrFill => "boolean",
373 RestoreInfoKeepCnt => "boolean",
374 ArchiveInfoKeepCnt => "boolean",
375 BackupFilesOnly => "boolean",
376 BackupFilesExclude => "boolean",
377 BackupsDisable => "boolean",
378 BlackoutBadPingLimit => "boolean",
379 BlackoutGoodCnt => "boolean",
380 BlackoutPeriods => "boolean",
381 BackupZeroFilesIsFatal => "boolean",
382 XferMethod => "boolean",
383 XferLogLevel => "boolean",
384 ClientCharset => "boolean",
385 SmbShareName => "boolean",
386 SmbShareUserName => "boolean",
387 SmbSharePasswd => "boolean",
388 SmbClientFullCmd => "boolean",
389 SmbClientIncrCmd => "boolean",
390 SmbClientRestoreCmd => "boolean",
391 TarShareName => "boolean",
392 TarFullArgs => "boolean",
393 TarIncrArgs => "boolean",
394 TarClientCmd => "boolean",
395 TarClientRestoreCmd => "boolean",
396 RsyncShareName => "boolean",
397 RsyncdClientPort => "boolean",
398 RsyncdPasswd => "boolean",
399 RsyncdAuthRequired => "boolean",
400 RsyncCsumCacheVerifyProb => "boolean",
401 RsyncArgs => "boolean",
402 RsyncRestoreArgs => "boolean",
403 RsyncClientCmd => "boolean",
404 RsyncClientRestoreCmd => "boolean",
405 ArchiveDest => "boolean",
406 ArchiveComp => "boolean",
407 ArchivePar => "boolean",
408 ArchiveSplit => "boolean",
409 ArchiveClientCmd => "boolean",
410 FixedIPNetBiosNameCheck => "boolean",
411 PingMaxMsec => "boolean",
412 NmbLookupCmd => "boolean",
413 NmbLookupFindHostCmd => "boolean",
414 PingCmd => "boolean",
415 ClientTimeout => "boolean",
416 MaxOldPerPCLogFiles => "boolean",
417 CompressLevel => "boolean",
418 ClientNameAlias => "boolean",
419 DumpPreUserCmd => "boolean",
420 DumpPostUserCmd => "boolean",
421 RestorePreUserCmd => "boolean",
422 RestorePostUserCmd => "boolean",
423 ArchivePreUserCmd => "boolean",
424 ArchivePostUserCmd => "boolean",
425 DumpPostShareCmd => "boolean",
426 DumpPreShareCmd => "boolean",
427 UserCmdCheckStatus => "boolean",
428 EMailNotifyMinDays => "boolean",
429 EMailFromUserName => "boolean",
430 EMailAdminUserName => "boolean",
431 EMailUserDestDomain => "boolean",
432 EMailNoBackupEverSubj => "boolean",
433 EMailNoBackupEverMesg => "boolean",
434 EMailNotifyOldBackupDays => "boolean",
435 EMailNoBackupRecentSubj => "boolean",
436 EMailNoBackupRecentMesg => "boolean",
437 EMailNotifyOldOutlookDays => "boolean",
438 EMailOutlookBackupSubj => "boolean",
439 EMailOutlookBackupMesg => "boolean",
440 EMailHeaders => "boolean",
444 ######################################################################
445 # Fake config setting for editing the hosts
446 ######################################################################
452 order => [qw(host dhcp user moreUsers)],
455 host => { type => "string", size => 20 },
456 dhcp => { type => "boolean" },
457 user => { type => "string", size => 20 },
458 moreUsers => { type => "string", size => 30 },