Changeset 2324 in MondoRescue for branches/2.2.10/mondo/src/mondorestore/mondorestore.c
- Timestamp:
- Aug 18, 2009, 3:13:54 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.10/mondo/src/mondorestore/mondorestore.c
r2323 r2324 918 918 popup_and_OK(tmp); 919 919 mr_free(tmp); 920 log_to_screen 921 ("Mondo has restored your system. Please wait for the command prompt."); 922 log_to_screen 923 ("Then remove the backup media and reboot."); 924 log_to_screen 925 ("Please visit our website at http://www.mondorescue.org for more information."); 920 log_to_screen("Mondo has restored your system. Please wait for the command prompt."); 921 log_to_screen("Then remove the backup media and reboot."); 922 log_to_screen("Please visit our website at http://www.mondorescue.org for more information."); 926 923 } 927 924 g_I_have_just_nuked = TRUE; … … 1159 1156 use_ntfsprog_hack = TRUE; 1160 1157 log_msg(2, "Calling ntfsclone in background because %s is an NTFS /dev entry", outfile_fname); 1161 mr_asprintf(sz_devfile, "/tmp/%d.%d.000", (int) (random() % 32768), 1162 (int) (random() % 32768)); 1158 mr_asprintf(sz_devfile, "/tmp/%d.%d.000", (int) (random() % 32768), (int) (random() % 32768)); 1163 1159 mkfifo(sz_devfile, 0x770); 1164 1160 strcpy(ntfsprog_fifo, sz_devfile); … … 1232 1228 mr_free(mds); 1233 1229 1234 mr_asprintf(tmp, "Restoring from %s #%d", mds, g_current_media_number); 1235 log_to_screen(tmp); 1236 mr_free(tmp); 1230 log_to_screen("Restoring from %s #%d", mds, g_current_media_number); 1237 1231 1238 1232 insist_on_this_cd_number(g_current_media_number); … … 1279 1273 mr_free(tmp); 1280 1274 if (bzip2_command != NULL) { 1281 mr_strcat(bzip2_command, " -dc %s 2>> %s", 1282 slice_fname(bigfileno, sliceno, ARCHIVES_PATH, suffix), MONDO_LOGFILE); 1275 mr_strcat(bzip2_command, " -dc %s 2>> %s", slice_fname(bigfileno, sliceno, ARCHIVES_PATH, suffix), MONDO_LOGFILE); 1283 1276 } else { 1284 mr_asprintf(bzip2_command, "cat %s 2>> %s", 1285 slice_fname(bigfileno, sliceno, ARCHIVES_PATH, suffix), MONDO_LOGFILE); 1277 mr_asprintf(bzip2_command, "cat %s 2>> %s", slice_fname(bigfileno, sliceno, ARCHIVES_PATH, suffix), MONDO_LOGFILE); 1286 1278 } 1287 1279 mds = media_descriptor_string(bkpinfo->backup_media_type); … … 1627 1619 char *executable = NULL; 1628 1620 char *temp_log = NULL; 1629 char *screen_message = NULL;1630 1621 long matches = 0; 1631 1622 bool use_star; … … 1654 1645 log_msg(3, "length_of_file(%s) = %llu", tarball_fname, length_of_file(tarball_fname)); 1655 1646 log_msg(3, "count_lines_in_file(%s) = %llu", tarball_fname, count_lines_in_file(tarball_fname)); 1656 mr_asprintf(tmp, "Unable to restore fileset #%ld (CD I/O error)", current_tarball_number); 1657 log_to_screen(tmp); 1658 mr_free(tmp); 1647 log_to_screen("Unable to restore fileset #%ld (CD I/O error)", current_tarball_number); 1659 1648 mr_free(filelist_name); 1660 1649 log_msg(5, "Leaving"); … … 1672 1661 log_msg(3, "Saved fileset %ld's subset to %s", current_tarball_number, filelist_subset_fname); 1673 1662 } 1674 mr_asprintf(screen_message, "Tarball #%ld --- %ld matches", current_tarball_number, matches); 1675 log_to_screen(screen_message); 1676 mr_free(screen_message); 1663 log_to_screen("Tarball #%ld --- %ld matches", current_tarball_number, matches); 1677 1664 } 1678 1665 mr_free(filelist_name); … … 2066 2053 } else if (does_file_exist(MNT_CDROM "/archives/NOT-THE-LAST")) { 2067 2054 insist_on_this_cd_number(++g_current_media_number); 2068 mr_asprintf(tmp1, "Restoring from %s #%d", mds, g_current_media_number); 2069 log_to_screen(tmp1); 2070 mr_free(tmp1); 2055 log_to_screen("Restoring from %s #%d", mds, g_current_media_number); 2071 2056 just_changed_cds = TRUE; 2072 2057 } else { … … 2228 2213 } else { 2229 2214 mr_asprintf(progress_str, "Restoring from fileset #%ld on %s #%d", current_tarball_number, mds, g_current_media_number); 2230 for (res = 999, attempts = 0; attempts < 3 && res != 0; 2231 attempts++) { 2232 res = 2233 restore_a_tarball_from_CD(tarball_fname, 2234 current_tarball_number, 2235 filelist); 2215 for (res = 999, attempts = 0; attempts < 3 && res != 0; attempts++) { 2216 res = restore_a_tarball_from_CD(tarball_fname, current_tarball_number, filelist); 2236 2217 } 2237 2218 mr_asprintf(tmp1, "%s #%d, fileset #%ld - restore ", mds, g_current_media_number, current_tarball_number); … … 2247 2228 } 2248 2229 strcpy(comment, tmp1); 2249 paranoid_free(tmp1);2230 mr_free(tmp1); 2250 2231 if (attempts > 1) { 2251 2232 log_to_screen(comment); … … 2519 2500 retval += res; 2520 2501 if (res) { 2521 mr_asprintf(tmp, "Fileset %ld - errors occurred", current_afioball_number); 2522 log_to_screen(tmp); 2523 mr_free(tmp); 2502 log_to_screen("Fileset %ld - errors occurred", current_afioball_number); 2524 2503 } 2525 2504 res = … … 2958 2937 log_msg(1, "Mounting nfs dir"); 2959 2938 mr_free(bkpinfo->isodir); 2960 mr_asprintf(tmp, "/tmp/isodir"); 2961 bkpinfo->isodir = tmp; 2939 mr_asprintf(bkpinfo->isodir, "/tmp/isodir"); 2962 2940 run_program_and_log_output("mkdir -p /tmp/isodir", 5); 2963 2941 mr_asprintf(tmp, "mount %s -t nfs -o nolock,ro /tmp/isodir", bkpinfo->nfs_mount); … … 2968 2946 2969 2947 if (retval) { 2970 log_to_screen 2971 ("Warning - load_raidtab_into_raidlist returned an error"); 2948 log_to_screen("Warning - load_raidtab_into_raidlist returned an error"); 2972 2949 } 2973 2950 … … 3079 3056 set_signals(FALSE); 3080 3057 log_to_screen("Restore log (%s) copied to /var/log on your hard disk", MONDO_LOGFILE); 3081 mr_asprintf(tmp, "Mondo-restore is exiting (retval=%d) ", retval); 3082 log_to_screen(tmp); 3083 mr_free(tmp); 3058 log_to_screen("Mondo-restore is exiting (retval=%d) ", retval); 3084 3059 3085 3060 mr_asprintf(tmp, "umount %s", bkpinfo->isodir);
Note:
See TracChangeset
for help on using the changeset viewer.