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.0alpha, released 23 Jan 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 => "string", 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 => "integer",
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",
346 CgiHeaders => "bigstring",
347 CgiImageDir => "string",
348 CgiExt2ContentType => {
351 childType => "string",
353 CgiImageDirURL => "string",
354 CgiCSSFile => "string",
355 CgiUserConfigEditEnable => "boolean",
356 CgiUserConfigEdit => {
360 FullPeriod => "boolean",
361 IncrPeriod => "boolean",
362 FullKeepCnt => "boolean",
363 FullKeepCntMin => "boolean",
364 FullAgeMax => "boolean",
365 IncrKeepCnt => "boolean",
366 IncrKeepCntMin => "boolean",
367 IncrAgeMax => "boolean",
368 PartialAgeMax => "boolean",
369 IncrFill => "boolean",
370 RestoreInfoKeepCnt => "boolean",
371 ArchiveInfoKeepCnt => "boolean",
372 BackupFilesOnly => "boolean",
373 BackupFilesExclude => "boolean",
374 BlackoutBadPingLimit => "boolean",
375 BlackoutGoodCnt => "boolean",
376 BlackoutPeriods => "boolean",
377 BackupZeroFilesIsFatal => "boolean",
378 XferMethod => "boolean",
379 XferLogLevel => "boolean",
380 ClientCharset => "boolean",
381 SmbShareName => "boolean",
382 SmbShareUserName => "boolean",
383 SmbSharePasswd => "boolean",
384 SmbClientFullCmd => "boolean",
385 SmbClientIncrCmd => "boolean",
386 SmbClientRestoreCmd => "boolean",
387 TarShareName => "boolean",
388 TarFullArgs => "boolean",
389 TarIncrArgs => "boolean",
390 TarClientCmd => "boolean",
391 TarClientRestoreCmd => "boolean",
392 RsyncShareName => "boolean",
393 RsyncdClientPort => "boolean",
394 RsyncdPasswd => "boolean",
395 RsyncdAuthRequired => "boolean",
396 RsyncCsumCacheVerifyProb => "boolean",
397 RsyncArgs => "boolean",
398 RsyncRestoreArgs => "boolean",
399 RsyncClientCmd => "boolean",
400 RsyncClientRestoreCmd => "boolean",
401 ArchiveDest => "boolean",
402 ArchiveComp => "boolean",
403 ArchivePar => "boolean",
404 ArchiveSplit => "boolean",
405 ArchiveClientCmd => "boolean",
406 FixedIPNetBiosNameCheck => "boolean",
407 PingMaxMsec => "boolean",
408 NmbLookupCmd => "boolean",
409 NmbLookupFindHostCmd => "boolean",
410 PingCmd => "boolean",
411 ClientTimeout => "boolean",
412 MaxOldPerPCLogFiles => "boolean",
413 CompressLevel => "boolean",
414 ClientNameAlias => "boolean",
415 DumpPreUserCmd => "boolean",
416 DumpPostUserCmd => "boolean",
417 RestorePreUserCmd => "boolean",
418 RestorePostUserCmd => "boolean",
419 ArchivePreUserCmd => "boolean",
420 ArchivePostUserCmd => "boolean",
421 DumpPostShareCmd => "boolean",
422 DumpPreShareCmd => "boolean",
423 EMailNotifyMinDays => "boolean",
424 EMailFromUserName => "boolean",
425 EMailAdminUserName => "boolean",
426 EMailUserDestDomain => "boolean",
427 EMailNoBackupEverSubj => "boolean",
428 EMailNoBackupEverMesg => "boolean",
429 EMailNotifyOldBackupDays => "boolean",
430 EMailNoBackupRecentSubj => "boolean",
431 EMailNoBackupRecentMesg => "boolean",
432 EMailNotifyOldOutlookDays => "boolean",
433 EMailOutlookBackupSubj => "boolean",
434 EMailOutlookBackupMesg => "boolean",
438 ######################################################################
439 # Fake config setting for editing the hosts
440 ######################################################################
446 order => [qw(host dhcp user moreUsers)],
449 host => { type => "string", size => 20 },
450 dhcp => { type => "boolean" },
451 user => { type => "string", size => 20 },
452 moreUsers => { type => "string", size => 30 },