Handle hostnames with upper-case letters
[webmin.git] / cron / backup_config.pl
1
2 do 'cron-lib.pl';
3
4 # backup_config_files()
5 # Returns files and directories that can be backed up
6 sub backup_config_files
7 {
8 local @rv;
9 push(@rv, map { $_->{'file'} } &list_cron_jobs());
10 push(@rv, $config{'cron_allow_file'}) if ($config{'cron_allow_file'});
11 push(@rv, $config{'cron_deny_file'}) if ($config{'cron_deny_file'});
12 push(@rv, $config{'system_crontab'}) if ($config{'system_crontab'});
13 return &unique(@rv);
14 }
15
16 # pre_backup(&files)
17 # Called before the files are actually read
18 sub pre_backup
19 {
20 return undef;
21 }
22
23 # post_backup(&files)
24 # Called after the files are actually read
25 sub post_backup
26 {
27 return undef;
28 }
29
30 # pre_restore(&files)
31 # Called before the files are restored from a backup
32 sub pre_restore
33 {
34 return undef;
35 }
36
37 # post_restore(&files)
38 # Called after the files are restored from a backup
39 sub post_restore
40 {
41 if (!$fcron) {
42         # Re-activate all user cron jobs
43         local $user;
44         opendir(DIR, $config{'cron_dir'});
45         while($user = readdir(DIR)) {
46                 system("cp $config{'cron_dir'}/$user $cron_temp_file");
47                 &copy_crontab($user);
48                 }
49         closedir(DIR);
50         }
51 return undef;
52 }
53
54 1;
55