1 2do 'mysql-lib.pl'; 3 4# backup_config_files() 5# Returns files and directories that can be backed up 6sub backup_config_files 7{ 8return &get_all_mysqld_files(); 9} 10 11# pre_backup(&files) 12# Called before the files are actually read 13sub pre_backup 14{ 15return undef; 16} 17 18# post_backup(&files) 19# Called after the files are actually read 20sub post_backup 21{ 22return undef; 23} 24 25# pre_restore(&files) 26# Called before the files are restored from a backup 27sub pre_restore 28{ 29if (&is_mysql_running() != -1) { 30 %oldconfig = %config; 31 } 32else { 33 %oldconfig = ( ); 34 } 35return undef; 36} 37 38# post_restore(&files) 39# Called after the files are restored from a backup 40sub post_restore 41{ 42$authstr = &make_authstr(); 43&read_file_cached($module_config_file, \%config); 44if (&is_mysql_running() == -1 && %oldconfig) { 45 # New restored login isn't valid .. put back the old one 46 $config{'login'} = $oldconfig{'login'}; 47 $config{'pass'} = $oldconfig{'pass'}; 48 &save_module_config(); 49 } 50if (&is_mysql_running()) { 51 &stop_mysql(); 52 return &start_mysql(); 53 } 54return undef; 55} 56 571; 58 59