1 2require 'cron-lib.pl'; 3 4# backup_config_files() 5# Returns files and directories that can be backed up 6sub backup_config_files 7{ 8local @rv; 9push(@rv, map { $_->{'file'} } &list_cron_jobs()); 10push(@rv, $config{'cron_allow_file'}) if ($config{'cron_allow_file'}); 11push(@rv, $config{'cron_deny_file'}) if ($config{'cron_deny_file'}); 12push(@rv, $config{'system_crontab'}) if ($config{'system_crontab'}); 13return &unique(@rv); 14} 15 16# pre_backup(&files) 17# Called before the files are actually read 18sub pre_backup 19{ 20return undef; 21} 22 23# post_backup(&files) 24# Called after the files are actually read 25sub post_backup 26{ 27return undef; 28} 29 30# pre_restore(&files) 31# Called before the files are restored from a backup 32sub pre_restore 33{ 34return undef; 35} 36 37# post_restore(&files) 38# Called after the files are restored from a backup 39sub post_restore 40{ 41if (!$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 ©_crontab($user); 48 } 49 closedir(DIR); 50 } 51return undef; 52} 53 541; 55 56