4 # backup_config_files()
5 # Returns files and directories that can be backed up
6 sub backup_config_files
8 local @rv = ( $config{'webalizer_conf'} );
10 opendir(DIR, $module_config_directory);
11 while($f = readdir(DIR)) {
12 if ($f =~ /\.conf$/ || $f =~ /\.log$/) {
13 push(@rv, "$module_config_directory/$f");
21 # Called before the files are actually read
28 # Called after the files are actually read
35 # Called before the files are restored from a backup
41 # post_restore(&files)
42 # Called after the files are restored from a backup
45 # Re-setup all needed cron jobs
46 &foreign_require("cron", "cron-lib.pl");
47 local @jobs = &cron::list_cron_jobs();
48 foreach $log (&get_all_logs()) {
49 local $lconf = &get_log_config($log->{'file'});
50 if ($lconf->{'sched'}) {
51 local ($job) = grep { $_->{'command'} eq
52 "$cron_cmd $log->{'file'}" } @jobs;
55 $job->{'user'} = 'root';
57 $job->{'special'} = $lconf->{'special'};
58 $job->{'mins'} = $lconf->{'mins'};
59 $job->{'hours'} = $lconf->{'hours'};
60 $job->{'days'} = $lconf->{'days'};
61 $job->{'months'} = $lconf->{'months'};
62 $job->{'weekdays'} = $lconf->{'weekdays'};
63 $job->{'command'} = "$cron_cmd $log->{'file'}";
64 &cron::create_cron_job($job);