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",
142 PartialAgeMax => "float",
143 IncrFill => "boolean",
144 RestoreInfoKeepCnt => "integer",
145 ArchiveInfoKeepCnt => "integer",
156 BackupFilesExclude => {
166 BlackoutBadPingLimit => "integer",
167 BlackoutGoodCnt => "integer",
175 hourBegin => "float",
185 BackupZeroFilesIsFatal => "boolean",
187 ######################################################################
188 # How to backup a client
189 ######################################################################
192 values => [qw(archive rsync rsyncd smb tar)],
194 XferLogLevel => "integer",
196 ClientCharset => "string",
202 SmbShareUserName => "string",
203 SmbSharePasswd => "string",
204 SmbClientPath => {type => "string", undefIfEmpty => 1},
205 SmbClientFullCmd => "string",
206 SmbClientIncrCmd => "string",
207 SmbClientRestoreCmd => "string",
213 TarClientCmd => "string",
214 TarFullArgs => "string",
215 TarIncrArgs => "string",
216 TarClientRestoreCmd => "string",
217 TarClientPath => {type => "string", undefIfEmpty => 1},
223 RsyncClientPath => {type => "string", undefIfEmpty => 1},
224 RsyncClientCmd => "string",
225 RsyncClientRestoreCmd => "string",
227 RsyncdClientPort => "integer",
228 RsyncdUserName => "string",
229 RsyncdPasswd => "string",
230 RsyncdAuthRequired => "boolean",
232 RsyncCsumCacheVerifyProb => "float",
238 RsyncRestoreArgs => {
244 BackupPCdCmd => "string",
245 BackupPCdPath => "string",
246 BackupPCdShareName => "string",
247 BackupPCdRestoreCmd => "string",
249 ArchiveDest => "string",
252 values => [qw(none bzip2 gzip)],
254 ArchivePar => "boolean",
255 ArchiveSplit => "float",
256 ArchiveClientCmd => "string",
258 NmbLookupCmd => "string",
259 NmbLookupFindHostCmd => "string",
261 FixedIPNetBiosNameCheck => "boolean",
263 PingMaxMsec => "float",
265 ClientTimeout => "integer",
267 MaxOldPerPCLogFiles => "integer",
269 CompressLevel => "integer",
271 DumpPreUserCmd => {type => "string", undefIfEmpty => 1},
272 DumpPostUserCmd => {type => "string", undefIfEmpty => 1},
273 DumpPreShareCmd => {type => "string", undefIfEmpty => 1},
274 DumpPostShareCmd => {type => "string", undefIfEmpty => 1},
275 RestorePreUserCmd => {type => "string", undefIfEmpty => 1},
276 RestorePostUserCmd => {type => "string", undefIfEmpty => 1},
277 ArchivePreUserCmd => {type => "string", undefIfEmpty => 1},
278 ArchivePostUserCmd => {type => "string", undefIfEmpty => 1},
280 ClientNameAlias => {type => "string", undefIfEmpty => 1},
282 ######################################################################
283 # Email reminders, status and messages
284 # (can be overridden in the per-PC config.pl)
285 ######################################################################
286 SendmailPath => {type => "execPath", undefIfEmpty => 1},
287 EMailNotifyMinDays => "float",
288 EMailFromUserName => "string",
289 EMailAdminUserName => "string",
290 EMailUserDestDomain => "string",
291 EMailNoBackupEverSubj => {type => "string", undefIfEmpty => 1},
292 EMailNoBackupEverMesg => {type => "bigstring", undefIfEmpty => 1},
293 EMailNotifyOldBackupDays => "float",
294 EMailNoBackupRecentSubj => {type => "string", undefIfEmpty => 1},
295 EMailNoBackupRecentMesg => {type => "bigstring", undefIfEmpty => 1},
296 EMailNotifyOldOutlookDays => "float",
297 EMailOutlookBackupSubj => {type => "string", undefIfEmpty => 1},
298 EMailOutlookBackupMesg => {type => "bigstring", undefIfEmpty => 1},
299 EMailHeaders => {type => "bigstring", undefIfEmpty => 1},
301 ######################################################################
302 # CGI user interface configuration settings
303 ######################################################################
304 CgiAdminUserGroup => "string",
305 CgiAdminUsers => "string",
309 values => [qw(de en es fr it nl pt_br)],
311 CgiUserHomePageCheck => "string",
312 CgiUserUrlCreate => "string",
313 CgiDateFormatMMDD => "boolean",
314 CgiNavBarAdminAllHosts => "boolean",
315 CgiSearchBoxEnable => "boolean",
324 lname => {type => "string", undefIfEmpty => 1},
325 name => {type => "string", undefIfEmpty => 1},
329 CgiStatusHilightColor => {
333 Reason_backup_failed => "string",
334 Reason_backup_done => "string",
335 Reason_no_ping => "string",
336 Reason_backup_canceled_by_user => "string",
337 Status_backup_in_progress => "string",
340 CgiHeaders => "bigstring",
341 CgiImageDir => "string",
342 CgiExt2ContentType => {
345 childType => "string",
347 CgiImageDirURL => "string",
348 CgiCSSFile => "string",
349 CgiUserConfigEditEnable => "boolean",
350 CgiUserConfigEdit => {
354 FullPeriod => "boolean",
355 IncrPeriod => "boolean",
356 FullKeepCnt => "boolean",
357 FullKeepCntMin => "boolean",
358 FullAgeMax => "boolean",
359 IncrKeepCnt => "boolean",
360 IncrKeepCntMin => "boolean",
361 IncrAgeMax => "boolean",
362 PartialAgeMax => "boolean",
363 IncrFill => "boolean",
364 RestoreInfoKeepCnt => "boolean",
365 ArchiveInfoKeepCnt => "boolean",
366 BackupFilesOnly => "boolean",
367 BackupFilesExclude => "boolean",
368 BlackoutBadPingLimit => "boolean",
369 BlackoutGoodCnt => "boolean",
370 BlackoutPeriods => "boolean",
371 BackupZeroFilesIsFatal => "boolean",
372 XferMethod => "boolean",
373 XferLogLevel => "boolean",
374 ClientCharset => "boolean",
375 SmbShareName => "boolean",
376 SmbShareUserName => "boolean",
377 SmbSharePasswd => "boolean",
378 SmbClientFullCmd => "boolean",
379 SmbClientIncrCmd => "boolean",
380 SmbClientRestoreCmd => "boolean",
381 TarShareName => "boolean",
382 TarFullArgs => "boolean",
383 TarIncrArgs => "boolean",
384 TarClientCmd => "boolean",
385 TarClientRestoreCmd => "boolean",
386 RsyncShareName => "boolean",
387 RsyncdClientPort => "boolean",
388 RsyncdPasswd => "boolean",
389 RsyncdAuthRequired => "boolean",
390 RsyncCsumCacheVerifyProb => "boolean",
391 RsyncArgs => "boolean",
392 RsyncRestoreArgs => "boolean",
393 RsyncClientCmd => "boolean",
394 RsyncClientRestoreCmd => "boolean",
395 ArchiveDest => "boolean",
396 ArchiveComp => "boolean",
397 ArchivePar => "boolean",
398 ArchiveSplit => "boolean",
399 ArchiveClientCmd => "boolean",
400 FixedIPNetBiosNameCheck => "boolean",
401 PingMaxMsec => "boolean",
402 NmbLookupCmd => "boolean",
403 NmbLookupFindHostCmd => "boolean",
404 PingCmd => "boolean",
405 ClientTimeout => "boolean",
406 MaxOldPerPCLogFiles => "boolean",
407 CompressLevel => "boolean",
408 ClientNameAlias => "boolean",
409 DumpPreUserCmd => "boolean",
410 DumpPostUserCmd => "boolean",
411 RestorePreUserCmd => "boolean",
412 RestorePostUserCmd => "boolean",
413 ArchivePreUserCmd => "boolean",
414 ArchivePostUserCmd => "boolean",
415 DumpPostShareCmd => "boolean",
416 DumpPreShareCmd => "boolean",
417 EMailNotifyMinDays => "boolean",
418 EMailFromUserName => "boolean",
419 EMailAdminUserName => "boolean",
420 EMailUserDestDomain => "boolean",
421 EMailNoBackupEverSubj => "boolean",
422 EMailNoBackupEverMesg => "boolean",
423 EMailNotifyOldBackupDays => "boolean",
424 EMailNoBackupRecentSubj => "boolean",
425 EMailNoBackupRecentMesg => "boolean",
426 EMailNotifyOldOutlookDays => "boolean",
427 EMailOutlookBackupSubj => "boolean",
428 EMailOutlookBackupMesg => "boolean",
432 ######################################################################
433 # Fake config setting for editing the hosts
434 ######################################################################
440 order => [qw(host dhcp user moreUsers)],
443 host => { type => "string", size => 20 },
444 dhcp => { type => "boolean" },
445 user => { type => "string", size => 20 },
446 moreUsers => { type => "string", size => 30 },