Changeset 1086 in MondoRescue for trunk/mondo/src/common/libmondo-archive.c
- Timestamp:
- Feb 2, 2007, 11:21:27 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/mondo/src/common/libmondo-archive.c
r1081 r1086 142 142 143 143 if (semctl(g_sem_id, 0, IPC_RMID, sem_union) == -1) { 144 log_msg(3, "Failed to delete semaphore");144 mr_msg(3, "Failed to delete semaphore"); 145 145 } 146 146 } … … 159 159 sem_b.sem_flg = SEM_UNDO; 160 160 if (semop(g_sem_id, &sem_b, 1) == -1) { 161 log_msg(3, "semaphore_p failed");161 mr_msg(3, "semaphore_p failed"); 162 162 return (0); 163 163 } … … 177 177 sem_b.sem_flg = SEM_UNDO; 178 178 if (semop(g_sem_id, &sem_b, 1) == -1) { 179 log_msg(3, "semaphore_v failed");179 mr_msg(3, "semaphore_v failed"); 180 180 return (0); 181 181 } … … 237 237 mr_free(command); 238 238 command = tmp; 239 log_msg(4, "command = '%s'", command);239 mr_msg(4, "command = '%s'", command); 240 240 241 241 for (res = 99, tries = 0; tries < 3 && res != 0; tries++) { 242 log_msg(5, "command='%s'", command);242 mr_msg(5, "command='%s'", command); 243 243 res = system(command); 244 244 tmp = last_line_of_file(MONDO_LOGFILE); 245 log_msg(1, "res=%d; tmp='%s'", res, tmp);245 mr_msg(1, "res=%d; tmp='%s'", res, tmp); 246 246 if (bkpinfo->use_star && (res == 254 || res == 65024) 247 247 && strstr(tmp, "star: Processed all possible files") 248 248 && tries > 0) { 249 log_msg(1, "Star returned nonfatal error");249 mr_msg(1, "Star returned nonfatal error"); 250 250 res = 0; 251 251 } … … 256 256 if (p) { 257 257 p[0] = p[1] = p[2] = p[3] = ' '; 258 log_msg(1, "new command = '%s'", command);258 mr_msg(1, "new command = '%s'", command); 259 259 } else { 260 log_msg(3,260 mr_msg(3, 261 261 "Attempt #%d failed. Pausing 3 seconds and retrying...", 262 262 tries + 1); … … 269 269 retval += res; 270 270 if (retval) { 271 log_msg(3, "Failed to write set %d", setno);271 mr_msg(3, "Failed to write set %d", setno); 272 272 } else if (tries > 1) { 273 log_msg(3, "Succeeded in writing set %d, on try #%d", setno,273 mr_msg(3, "Succeeded in writing set %d, on try #%d", setno, 274 274 tries); 275 275 } … … 348 348 } else { 349 349 mr_asprintf(&zipparams, " "); 350 log_msg(3, "%s not found. Cannot exclude zipfiles, etc.", tmp);350 mr_msg(3, "%s not found. Cannot exclude zipfiles, etc.", tmp); 351 351 } 352 352 mr_free(tmp); … … 381 381 382 382 for (res = 99, tries = 0; tries < 3 && res != 0; tries++) { 383 log_msg(5, "command='%s'", command);383 mr_msg(5, "command='%s'", command); 384 384 res = system(command); 385 385 if (res) { 386 386 log_OS_error(command); 387 log_msg(3,387 mr_msg(3, 388 388 "Attempt #%d failed. Pausing 3 seconds and retrying...", 389 389 tries + 1); … … 395 395 retval += res; 396 396 if (retval) { 397 log_msg(3, "Failed to write set %d", setno);397 mr_msg(3, "Failed to write set %d", setno); 398 398 } else if (tries > 1) { 399 log_msg(3, "Succeeded in writing set %d, on try #%d", setno,399 mr_msg(3, "Succeeded in writing set %d, on try #%d", setno, 400 400 tries); 401 401 } … … 410 410 if (free_ramdisk_space > i) { 411 411 free_ramdisk_space = i; 412 log_msg(2, "min(free_ramdisk_space) is now %d",412 mr_msg(2, "min(free_ramdisk_space) is now %d", 413 413 free_ramdisk_space); 414 414 if (free_ramdisk_space < 10) { … … 507 507 retval += make_those_slices_phase(bkpinfo); // backup BIG files 508 508 retval += do_that_final_phase(bkpinfo); // clean up 509 log_msg(1, "Creation of archives... complete.");509 mr_msg(1, "Creation of archives... complete."); 510 510 if (bkpinfo->verify_data) { 511 511 sleep(2); … … 581 581 mr_free(tmp); 582 582 mr_asprintf(&tmp, "devs_to_exclude = '%s'", devs_to_exclude); 583 log_msg(2, tmp);583 mr_msg(2, tmp); 584 584 mr_free(tmp); 585 585 mvaddstr_and_log_it(g_currentY, 0, … … 673 673 mr_asprintf(&tmp, "User specified boot loader. It is '%c'.", 674 674 bkpinfo->boot_loader); 675 log_msg(2, tmp);675 mr_msg(2, tmp); 676 676 mr_free(tmp); 677 677 } else { … … 681 681 mr_asprintf(&tmp, "User specified boot device. It is '%s'.", 682 682 bkpinfo->boot_device); 683 log_msg(2, tmp);683 mr_msg(2, tmp); 684 684 mr_free(tmp); 685 685 mr_free(bootdev); … … 759 759 mr_asprintf(&tmp, "%s/BOOTLOADER.DEVICE", bkpinfo->tmpdir); 760 760 if (write_one_liner_data_file(tmp, bkpinfo->boot_device)) { 761 log_msg(1, "%ld: Unable to write one-liner boot device", __LINE__);761 mr_msg(1, "%ld: Unable to write one-liner boot device", __LINE__); 762 762 } 763 763 mr_free(tmp); … … 797 797 if (write_one_liner_data_file(tmp, value)) { 798 798 res++; 799 log_msg(1, "%ld: Unable to write one-liner backup-media-type",799 mr_msg(1, "%ld: Unable to write one-liner backup-media-type", 800 800 __LINE__); 801 801 } … … 806 806 if (write_one_liner_data_file(tmp, bootldr_str)) { 807 807 res++; 808 log_msg(1, "%ld: Unable to write one-liner bootloader.name",808 mr_msg(1, "%ld: Unable to write one-liner bootloader.name", 809 809 __LINE__); 810 810 } … … 822 822 mr_asprintf(&tmp1, "%s/XATTR", bkpinfo->tmpdir); 823 823 if (write_one_liner_data_file(tmp1, "TRUE")) { 824 log_msg(1, "%ld: Unable to write one-liner XATTR",824 mr_msg(1, "%ld: Unable to write one-liner XATTR", 825 825 __LINE__); 826 826 } … … 830 830 mr_asprintf(&tmp1, "%s/ACL", bkpinfo->tmpdir); 831 831 if (write_one_liner_data_file(tmp1, "TRUE")) { 832 log_msg(1, "%ld: Unable to write one-liner ACL",832 mr_msg(1, "%ld: Unable to write one-liner ACL", 833 833 __LINE__); 834 834 } … … 857 857 mr_free(tmp); 858 858 859 log_msg(1, "lines_in_filelist = %ld", lines_in_filelist);859 mr_msg(1, "lines_in_filelist = %ld", lines_in_filelist); 860 860 861 861 if (bkpinfo->backup_media_type == usb) { … … 911 911 mr_free(tmp2); 912 912 913 log_msg(2, command);913 mr_msg(2, command); 914 914 915 915 // popup_and_OK("Pausing"); … … 924 924 log_to_screen("Boot+data disks were created OK"); 925 925 mr_asprintf(&command, "mkdir -p /var/cache/mindi/"); 926 log_msg(2, command);926 mr_msg(2, command); 927 927 run_program_and_log_output(command, FALSE); 928 928 mr_free(command); … … 931 931 "cp -f %s/images/mindi.iso /var/cache/mindi/mondorescue.iso", 932 932 bkpinfo->scratchdir); 933 log_msg(2, command);933 mr_msg(2, command); 934 934 run_program_and_log_output(command, FALSE); 935 935 mr_free(command); … … 945 945 mr_asprintf(&command, "cp -f %s/mindi-*oot*.img %s/images", 946 946 bkpinfo->tmpdir, bkpinfo->scratchdir); 947 log_msg(2, command);947 mr_msg(2, command); 948 948 run_program_and_log_output(command, FALSE); 949 949 mr_free(command); … … 1047 1047 } 1048 1048 if (!semaphore_p()) { 1049 log_msg(3, "P sem failed (pid=%d)", (int) getpid());1049 mr_msg(3, "P sem failed (pid=%d)", (int) getpid()); 1050 1050 fatal_error("Cannot get semaphore P"); 1051 1051 } … … 1064 1064 bkpinfo->tmpdir, archiving_set_no); 1065 1065 if (!does_file_exist(archiving_filelist_fname)) { 1066 log_msg(3,1066 mr_msg(3, 1067 1067 "%s[%d:%d] - well, I would archive %d, except that it doesn't exist. I'll stop now.", 1068 1068 FORTY_SPACES, getpid(), this_thread_no, … … 1076 1076 archiving_set_no - ARCH_BUFFER_NUM, bkpinfo->zip_suffix); 1077 1077 if (does_file_exist(tmp)) { 1078 log_msg(4, "%s[%d:%d] - waiting for storer",1078 mr_msg(4, "%s[%d:%d] - waiting for storer", 1079 1079 FORTY_SPACES, getpid(), this_thread_no); 1080 1080 while (does_file_exist(tmp)) { 1081 1081 sleep(1); 1082 1082 } 1083 log_msg(4, "[%d] - continuing", getpid());1083 mr_msg(4, "[%d] - continuing", getpid()); 1084 1084 } 1085 1085 mr_free(tmp); 1086 1086 1087 log_msg(4, "%s[%d:%d] - EXATing %d...", FORTY_SPACES, getpid(),1087 mr_msg(4, "%s[%d:%d] - EXATing %d...", FORTY_SPACES, getpid(), 1088 1088 this_thread_no, archiving_set_no); 1089 1089 if (g_getfattr) { … … 1100 1100 } 1101 1101 1102 log_msg(4, "%s[%d:%d] - archiving %d...", FORTY_SPACES, getpid(),1102 mr_msg(4, "%s[%d:%d] - archiving %d...", FORTY_SPACES, getpid(), 1103 1103 this_thread_no, archiving_set_no); 1104 1104 res = archive_this_fileset(bkpinfo, archiving_filelist_fname, … … 1129 1129 fatal_error("Cannot get semaphore V"); 1130 1130 } 1131 log_msg(4, "%s[%d:%d] - archived %d OK", FORTY_SPACES, getpid(),1131 mr_msg(4, "%s[%d:%d] - archived %d OK", FORTY_SPACES, getpid(), 1132 1132 this_thread_no, archiving_set_no); 1133 1133 archiving_set_no++; … … 1142 1142 fatal_error("Cannot get semaphore V"); 1143 1143 } 1144 log_msg(3, "%s[%d:%d] - exiting", FORTY_SPACES, getpid(),1144 mr_msg(3, "%s[%d:%d] - exiting", FORTY_SPACES, getpid(), 1145 1145 this_thread_no); 1146 1146 mr_free(archiving_filelist_fname); … … 1171 1171 "Writing any remaining data to media "); 1172 1172 1173 log_msg(1, "Closing tape/CD ... ");1173 mr_msg(1, "Closing tape/CD ... "); 1174 1174 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) { 1175 1175 /* write tape/cdstream */ … … 1180 1180 retval += res; 1181 1181 if (res) { 1182 log_msg(1, "write_final_iso_if_necessary returned an error");1183 } 1184 } 1185 log_msg(2, "Fork is exiting ... ");1182 mr_msg(1, "write_final_iso_if_necessary returned an error"); 1183 } 1184 } 1185 mr_msg(2, "Fork is exiting ... "); 1186 1186 1187 1187 mvaddstr_and_log_it(g_currentY++, 74, "Done."); … … 1234 1234 mr_free(g_serial_string); 1235 1235 g_serial_string = tmp; 1236 log_msg(2, "g_serial_string = '%s'", g_serial_string);1236 mr_msg(2, "g_serial_string = '%s'", g_serial_string); 1237 1237 1238 1238 mr_asprintf(&tmpfile, "%s/archives/SERIAL-STRING", bkpinfo->scratchdir); 1239 1239 if (write_one_liner_data_file(tmpfile, g_serial_string)) { 1240 log_msg(1, "%ld: Failed to write serial string", __LINE__);1240 mr_msg(1, "%ld: Failed to write serial string", __LINE__); 1241 1241 } 1242 1242 mr_free(g_serial_string); … … 1253 1253 fatal_error("Cannot open backup (streaming) device"); 1254 1254 } 1255 log_msg(1, "Backup (stream) opened OK");1255 mr_msg(1, "Backup (stream) opened OK"); 1256 1256 write_data_disks_to_stream(data_disks_file); 1257 1257 } else { 1258 log_msg(1, "Backing up to CD's");1258 mr_msg(1, "Backing up to CD's"); 1259 1259 } 1260 1260 mr_free(data_disks_file); … … 1324 1324 mr_asprintf(&command, "%s >> %s 2>> %s; rm -f %s", cmd, tempfile, 1325 1325 tempfile, tempfile); 1326 log_msg(3, command);1326 mr_msg(3, command); 1327 1327 open_evalcall_form(title); 1328 1328 if (!(pin = popen(command, "r"))) { … … 1340 1340 trackno = get_trackno_from_logfile(tempfile); 1341 1341 if (trackno < 0 || trackno > 80) { 1342 log_msg(1, "Weird track#");1342 mr_msg(1, "Weird track#"); 1343 1343 continue; 1344 1344 } … … 1481 1481 int misc_counter_that_is_not_important = 0; 1482 1482 1483 log_msg(8, "here");1483 mr_msg(8, "here"); 1484 1484 assert(bkpinfo != NULL); 1485 1485 /* BERLIOS: To be removed */ … … 1501 1501 *p_next_set_to_archive = 0; 1502 1502 log_to_screen("Archiving regular files"); 1503 log_msg(5, "Go, Shorty. It's your birthday.");1503 mr_msg(5, "Go, Shorty. It's your birthday."); 1504 1504 open_progress_form(_("Backing up filesystem"), 1505 1505 _("I am backing up your live filesystem now."), … … 1508 1508 get_last_filelist_number(bkpinfo) + 1); 1509 1509 1510 log_msg(5, "We're gonna party like it's your birthday.");1510 mr_msg(5, "We're gonna party like it's your birthday."); 1511 1511 1512 1512 srand((unsigned int) getpid()); … … 1521 1521 } // initialize semaphore 1522 1522 for (noof_threads = 0; noof_threads < ARCH_THREADS; noof_threads++) { 1523 log_msg(8, "Creating thread #%d", noof_threads);1523 mr_msg(8, "Creating thread #%d", noof_threads); 1524 1524 (*p_archival_threads_running)++; 1525 1525 if ((res = … … 1531 1531 } 1532 1532 1533 log_msg(8, "About to enter while() loop");1533 mr_msg(8, "About to enter while() loop"); 1534 1534 while (!done_storing) { 1535 1535 if (g_exiting) { … … 1538 1538 if (*p_archival_threads_running == 0 1539 1539 && *p_last_set_archived == storing_set_no - 1) { 1540 log_msg(2,1540 mr_msg(2, 1541 1541 "No archival threads are running. The last stored set was %d and I'm looking for %d. Take off your make-up; the party's over... :-)", 1542 1542 *p_last_set_archived, storing_set_no); … … 1572 1572 } 1573 1573 1574 log_msg(2, "Storing set %d", storing_set_no);1574 mr_msg(2, "Storing set %d", storing_set_no); 1575 1575 while (!does_file_exist(storing_filelist_fname) 1576 1576 || !does_file_exist(storing_afioball_fname)) { 1577 log_msg(2,1577 mr_msg(2, 1578 1578 "Warning - either %s or %s doesn't exist yet. I'll pause 5 secs.", 1579 1579 storing_filelist_fname, storing_afioball_fname); … … 1644 1644 close_progress_form(); 1645 1645 1646 log_msg(2, "Joining background threads to foreground thread");1646 mr_msg(2, "Joining background threads to foreground thread"); 1647 1647 for (i = 0; i < noof_threads; i++) { 1648 1648 pthread_join(archival_thread[i], pvp); 1649 log_msg(3, "Thread %d of %d: closed OK", i + 1, noof_threads);1649 mr_msg(3, "Thread %d of %d: closed OK", i + 1, noof_threads); 1650 1650 } 1651 1651 del_semvalue(); 1652 log_msg(2, "Done.");1652 mr_msg(2, "Done."); 1653 1653 if (retval) { 1654 1654 mr_asprintf(&tmp, … … 1734 1734 } 1735 1735 1736 log_msg(2, "make_iso_fs --- scratchdir=%s --- destfile=%s",1736 mr_msg(2, "make_iso_fs --- scratchdir=%s --- destfile=%s", 1737 1737 bkpinfo->scratchdir, destfile); 1738 1738 /* BERLIOS: Do not ignore getcwd result */ … … 1759 1759 1760 1760 if (bkpinfo->call_make_iso != NULL) { 1761 log_msg(2, "bkpinfo->call_make_iso = %s", bkpinfo->call_make_iso);1761 mr_msg(2, "bkpinfo->call_make_iso = %s", bkpinfo->call_make_iso); 1762 1762 mr_asprintf(&tmp, "%s/archives/NOT-THE-LAST", bkpinfo->scratchdir); 1763 1763 mr_asprintf(&message_to_screen, "Making an ISO (%s #%d)", … … 1808 1808 mr_asprintf(&sz_blank_disk, "dvd+rw-format -force %s", 1809 1809 bkpinfo->media_device); 1810 log_msg(3, "sz_blank_disk = '%s'", sz_blank_disk);1810 mr_msg(3, "sz_blank_disk = '%s'", sz_blank_disk); 1811 1811 res = run_external_binary_with_percentage_indicator_NEW 1812 1812 ("Blanking DVD disk", sz_blank_disk); … … 1862 1862 bkpinfo->backup_media_string, 1863 1863 g_current_media_number); 1864 log_msg(1, message_to_screen);1864 mr_msg(1, message_to_screen); 1865 1865 mr_asprintf(&result_sz, "Call to mkisofs to make ISO (%s #%d) ", 1866 1866 bkpinfo->backup_media_string, 1867 1867 g_current_media_number); 1868 1868 if (bkpinfo->nonbootable_backup) { 1869 log_msg(1, "Making nonbootable backup");1869 mr_msg(1, "Making nonbootable backup"); 1870 1870 // FIXME --- change mkisofs string to MONDO_MKISOFS_NONBOOTABLE and add ' .' at end 1871 1871 res = eval_call_to_make_ISO(bkpinfo, … … 1874 1874 MONDO_LOGFILE, message_to_screen); 1875 1875 } else { 1876 log_msg(1, "Making bootable backup");1876 mr_msg(1, "Making bootable backup"); 1877 1877 1878 1878 #ifdef __FreeBSD__ … … 1881 1881 1882 1882 1883 log_msg(1, "make_cd_use_lilo is actually %d",1883 mr_msg(1, "make_cd_use_lilo is actually %d", 1884 1884 bkpinfo->make_cd_use_lilo); 1885 1885 if (bkpinfo->make_cd_use_lilo) { 1886 log_msg(1, "make_cd_use_lilo = TRUE");1886 mr_msg(1, "make_cd_use_lilo = TRUE"); 1887 1887 // FIXME --- change mkisofs string to MONDO_MKISOFS_REGULAR_SYSLINUX/LILO depending on bkpinfo->make_cd_usE_lilo 1888 1888 // and add ' .' at end 1889 1889 #ifdef __IA64__ 1890 log_msg(1, "IA64 --> elilo");1890 mr_msg(1, "IA64 --> elilo"); 1891 1891 mr_asprintf(&tmp2,"mkisofs -no-emul-boot -b images/mindi-bootroot.%s.img -c boot.cat -o '_ISO_' -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_ .", bkpinfo->mrconf->mindi_ia64_boot_size); 1892 1892 res = eval_call_to_make_ISO(bkpinfo, … … 1900 1900 // and add ' .' at end 1901 1901 mr_free(tmp2); 1902 log_msg(1, "Non-ia64 --> lilo");1902 mr_msg(1, "Non-ia64 --> lilo"); 1903 1903 res = eval_call_to_make_ISO(bkpinfo, 1904 1904 "mkisofs -b images/mindi-bootroot.2880.img -c boot.cat -o '_ISO_' -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_ .", … … 1909 1909 #endif 1910 1910 } else { 1911 log_msg(1, "make_cd_use_lilo = FALSE");1912 log_msg(1, "Isolinux");1911 mr_msg(1, "make_cd_use_lilo = FALSE"); 1912 mr_msg(1, "Isolinux"); 1913 1913 res = eval_call_to_make_ISO(bkpinfo, 1914 1914 "mkisofs -no-emul-boot -b isolinux.bin -boot-load-size 4 -boot-info-table -c boot.cat -o '_ISO_' -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_ .", … … 1932 1932 || bkpinfo->backup_media_type == cdrw) { 1933 1933 if (is_this_device_mounted(bkpinfo->media_device)) { 1934 log_msg(2,1934 mr_msg(2, 1935 1935 "Warning - %s mounted. I'm unmounting it before I burn to it.", 1936 1936 bkpinfo->media_device); … … 1942 1942 1943 1943 if (bkpinfo->call_burn_iso != NULL) { 1944 log_msg(2, "bkpinfo->call_burn_iso = %s", bkpinfo->call_burn_iso);1944 mr_msg(2, "bkpinfo->call_burn_iso = %s", bkpinfo->call_burn_iso); 1945 1945 mr_asprintf(&message_to_screen, "Burning %s #%d", 1946 1946 bkpinfo->backup_media_string, … … 1977 1977 chdir(old_pwd); 1978 1978 if (retval) { 1979 log_msg(1, "WARNING - make_iso_fs returned an error");1979 mr_msg(1, "WARNING - make_iso_fs returned an error"); 1980 1980 } 1981 1981 mr_free(old_pwd); … … 1992 1992 "dd if=%s bs=512 count=1 2> /dev/null | strings | head -n1", 1993 1993 bigfile_fname); 1994 log_msg(1, "command = '%s'", command);1994 mr_msg(1, "command = '%s'", command); 1995 1995 tmp = call_program_and_get_last_line_of_output(command); 1996 log_msg(1, "--> tmp = '%s'", tmp);1996 mr_msg(1, "--> tmp = '%s'", tmp); 1997 1997 mr_free(command); 1998 1998 if (strstr(tmp, "NTFS")) { … … 2055 2055 size_of_all_biggiefiles_K(bkpinfo) / bkpinfo->optimal_set_size + 1; 2056 2056 2057 log_msg(1, "size of all biggiefiles = %ld",2057 mr_msg(1, "size of all biggiefiles = %ld", 2058 2058 size_of_all_biggiefiles_K(bkpinfo)); 2059 log_msg(1, "estimated_total_noof_slices = %ld KB / %ld KB = %ld",2059 mr_msg(1, "estimated_total_noof_slices = %ld KB / %ld KB = %ld", 2060 2060 size_of_all_biggiefiles_K(bkpinfo), bkpinfo->optimal_set_size, 2061 2061 estimated_total_noof_slices); 2062 2062 2063 2063 if (length_of_file(biggielist_fname) < 6) { 2064 log_msg(1, "No biggiefiles; fair enough...");2064 mr_msg(1, "No biggiefiles; fair enough..."); 2065 2065 return (0); 2066 2066 } … … 2095 2095 // Call ntfsclone (formerly partimagehack) if it's a /dev entry 2096 2096 // (i.e. a partition to be imaged) 2097 log_msg(2, "bigfile_fname = %s", bigfile_fname);2097 mr_msg(2, "bigfile_fname = %s", bigfile_fname); 2098 2098 use_ntfsprog = FALSE; 2099 2099 if (!strncmp(bigfile_fname, "/dev/", 5) 2100 2100 && is_dev_an_NTFS_dev(bigfile_fname)) { 2101 2101 use_ntfsprog = TRUE; 2102 log_msg(2,2102 mr_msg(2, 2103 2103 "Calling ntfsclone in background because %s is an NTFS partition", 2104 2104 bigfile_fname); … … 2113 2113 fatal_error("Fork failure"); 2114 2114 case 0: 2115 log_msg(2,2115 mr_msg(2, 2116 2116 "CHILD - fip - calling feed_into_ntfsprog(%s, %s)", 2117 2117 bigfile_fname, sz_devfile); … … 2120 2120 break; 2121 2121 default: 2122 log_msg(2,2122 mr_msg(2, 2123 2123 "feed_into_ntfsprog() called in background --- pid=%ld", 2124 2124 (long int) (pid)); … … 2133 2133 2134 2134 // Whether partition or biggiefile, just do your thang :-) 2135 log_msg(2, "Bigfile #%ld is '%s' (%ld KB)",2135 mr_msg(2, "Bigfile #%ld is '%s' (%ld KB)", 2136 2136 biggie_file_number + 1, bigfile_fname, 2137 2137 (long) biggie_fsize >> 10); … … 2180 2180 paranoid_fclose(fin); 2181 2181 2182 log_msg(1, "Finished backing up bigfiles");2183 log_msg(1, "estimated slices = %ld; actual slices = %ld",2182 mr_msg(1, "Finished backing up bigfiles"); 2183 mr_msg(1, "estimated slices = %ld; actual slices = %ld", 2184 2184 estimated_total_noof_slices, g_current_progress); 2185 2185 close_progress_form(); … … 2229 2229 bkpinfo->tmpdir, curr_set_no, bkpinfo->zip_suffix); 2230 2230 2231 log_msg(1, "EXAT'g set %ld", curr_set_no);2231 mr_msg(1, "EXAT'g set %ld", curr_set_no); 2232 2232 if (g_getfattr) { 2233 2233 mr_asprintf(&curr_xattr_list_fname, XATTR_LIST_FNAME_RAW_SZ, … … 2241 2241 } 2242 2242 2243 log_msg(1, "Archiving set %ld", curr_set_no);2243 mr_msg(1, "Archiving set %ld", curr_set_no); 2244 2244 res = archive_this_fileset(bkpinfo, curr_filelist_fname, 2245 2245 curr_afioball_fname, curr_set_no); … … 2349 2349 BLK_START_AFIOBALLS); 2350 2350 #if __FreeBSD__ == 5 2351 log_msg(1,2351 mr_msg(1, 2352 2352 "Using single-threaded make_afioballs_and_images() to suit b0rken FreeBSD 5.0"); 2353 2353 res = make_afioballs_and_images_OLD(bkpinfo); … … 2364 2364 if (res) { 2365 2365 mvaddstr_and_log_it(g_currentY++, 74, "Errors."); 2366 log_msg(1, "make_afioballs_and_images returned an error");2366 mr_msg(1, "make_afioballs_and_images returned an error"); 2367 2367 } else { 2368 2368 mvaddstr_and_log_it(g_currentY++, 74, "Done."); … … 2413 2413 2414 2414 mr_asprintf(&blah, "biggielist = %s", biggielist); 2415 log_msg(2, blah);2415 mr_msg(2, blah); 2416 2416 mr_free(blah); 2417 2417 2418 2418 if (!does_file_exist(biggielist)) { 2419 log_msg(1, "BTW, the biggielist does not exist");2419 mr_msg(1, "BTW, the biggielist does not exist"); 2420 2420 } 2421 2421 … … 2457 2457 retval += res; 2458 2458 if (res) { 2459 log_msg(1, "make_slices_and_images returned an error");2459 mr_msg(1, "make_slices_and_images returned an error"); 2460 2460 mvaddstr_and_log_it(g_currentY++, 74, "Errors."); 2461 2461 } else { … … 2519 2519 mr_asprintf(&curr_file, "%s", cf); 2520 2520 if (!does_file_exist(curr_file)) { 2521 log_msg(1,2521 mr_msg(1, 2522 2522 "Warning - you're trying to add a non-existent file - '%s' to the CD", 2523 2523 curr_file); 2524 2524 } else { 2525 log_msg(8, "Trying to add file %s to CD", curr_file);2525 mr_msg(8, "Trying to add file %s to CD", curr_file); 2526 2526 would_occupy += length_of_file(curr_file) / 1024; 2527 2527 } … … 2538 2538 retval += res; 2539 2539 if (res) { 2540 log_msg(1, "WARNING - write_iso_and_go_on returned an error");2540 mr_msg(1, "WARNING - write_iso_and_go_on returned an error"); 2541 2541 } 2542 2542 } … … 2554 2554 retval += res; 2555 2555 if (res) { 2556 log_msg(1, "(move_files_to_cd) '%s' failed", tmp);2556 mr_msg(1, "(move_files_to_cd) '%s' failed", tmp); 2557 2557 } else { 2558 log_msg(8, "Moved %s to CD OK", tmp);2558 mr_msg(8, "Moved %s to CD OK", tmp); 2559 2559 } 2560 2560 mr_free(tmp); … … 2565 2565 2566 2566 if (retval) { 2567 log_msg(1,2567 mr_msg(1, 2568 2568 "Warning - errors occurred while I was adding files to CD dir"); 2569 2569 } … … 2621 2621 mr_asprintf(&bootdisk_dev, "/dev/fd0H1722"); 2622 2622 } else { 2623 log_msg(1, "Warning - can't find a 1.72MB floppy device *sigh*");2623 mr_msg(1, "Warning - can't find a 1.72MB floppy device *sigh*"); 2624 2624 mr_asprintf(&bootdisk_dev, DEFAULT_1722MB_DISK); 2625 2625 } 2626 2626 mr_asprintf(&datadisk_dev, "%s", "/dev/fd0"); 2627 2627 if (!does_device_exist(datadisk_dev)) { 2628 log_msg(1, "Warning - can't find a 1.44MB floppy device *sigh*");2628 mr_msg(1, "Warning - can't find a 1.44MB floppy device *sigh*"); 2629 2629 mr_free(datadisk_dev); 2630 2630 mr_asprintf(&datadisk_dev, "%s", "/dev/fd0"); … … 2686 2686 } 2687 2687 mr_asprintf(&tmp, "cat %s > %s", rootdisk_file, datadisk_dev); 2688 log_msg(1, "tmp = '%s'", tmp);2688 mr_msg(1, "tmp = '%s'", tmp); 2689 2689 res += 2690 2690 run_external_binary_with_percentage_indicator_NEW … … 2707 2707 for (i = 1; i < 99; i++) { 2708 2708 mr_asprintf(&tmp, "%s/mindi-data-%d.img", imagesdir, i); 2709 log_msg(3, tmp);2709 mr_msg(3, tmp); 2710 2710 if (!does_file_exist(tmp)) { 2711 log_msg(3, "...not found");2711 mr_msg(3, "...not found"); 2712 2712 break; 2713 2713 } … … 2830 2830 mr_asprintf(&curr_file, "%s", cf); 2831 2831 if (!does_file_exist(curr_file)) { 2832 log_msg(1,2832 mr_msg(1, 2833 2833 "Warning - you're trying to add a non-existent file - '%s' to the tape", 2834 2834 curr_file); … … 2858 2858 2859 2859 if (retval) { 2860 log_msg(1,2860 mr_msg(1, 2861 2861 "Warning - errors occurred while I was adding file to tape"); 2862 2862 } … … 2890 2890 } else { 2891 2891 mr_asprintf(&cdrecord, " "); 2892 log_msg(2, "Found no cdrecord nor dvdrecord in path.");2892 mr_msg(2, "Found no cdrecord nor dvdrecord in path."); 2893 2893 } 2894 2894 if (cdrecord[0]) { … … 2944 2944 if (cdrom_dev != NULL) { 2945 2945 /* When enabled, it made CD eject-and-retract when wrong CD inserted.. Weird 2946 log_msg(2, "paafcd: Retracting CD-ROM drive if possible" );2946 mr_msg(2, "paafcd: Retracting CD-ROM drive if possible" ); 2947 2947 retract_CD_tray_and_defeat_autorun(); 2948 2948 */ … … 2957 2957 if ((attempt_to_mount_returned_this = 2958 2958 run_program_and_log_output(tmp, 1))) { 2959 log_msg(4, "Failed to mount %s at %s", cdrom_dev, mtpt);2959 mr_msg(4, "Failed to mount %s at %s", cdrom_dev, mtpt); 2960 2960 log_to_screen("If there's a CD/DVD in the drive, it's blank."); 2961 2961 mr_asprintf(&our_serial_str, "%s", ""); … … 2984 2984 mr_free(szunmount); 2985 2985 2986 log_msg(2, "paafcd: cd_number = %d", cd_number);2987 log_msg(2, "our serial str = %s; g_serial_string = %s",2986 mr_msg(2, "paafcd: cd_number = %d", cd_number); 2987 mr_msg(2, "our serial str = %s; g_serial_string = %s", 2988 2988 our_serial_str, g_serial_string); 2989 2989 if (cd_number > 0 && !strcmp(our_serial_str, g_serial_string)) { 2990 log_msg(2, "This %s is part of this backup set!",2990 mr_msg(2, "This %s is part of this backup set!", 2991 2991 g_backup_media_string); 2992 2992 ok_go_ahead_burn_it = FALSE; … … 3005 3005 mr_free(our_serial_str); 3006 3006 } else { 3007 log_msg(2,3007 mr_msg(2, 3008 3008 "paafcd: Can't find CD-ROM drive. Perhaps it has a blank %s in it?", 3009 3009 g_backup_media_string); … … 3028 3028 goto gotos_make_me_puke; 3029 3029 } else { 3030 log_msg(2, "paafcd: OK, going ahead and burning it.");3030 mr_msg(2, "paafcd: OK, going ahead and burning it."); 3031 3031 } 3032 3032 mr_free(cdrom_dev); 3033 3033 3034 log_msg(2,3034 mr_msg(2, 3035 3035 "paafcd: OK, I assume I have a blank/reusable %s in the drive...", 3036 3036 g_backup_media_string); … … 3161 3161 file_to_openin = ntfsprog_fifo; 3162 3162 mr_asprintf(&checksum_line, "IGNORE"); 3163 log_msg(2,3163 mr_msg(2, 3164 3164 "Not calculating checksum for %s: it would take too long", 3165 3165 biggie_filename); … … 3221 3221 paranoid_fclose(fout); 3222 3222 length = totallength / optimal_set_size / 1024; 3223 log_msg(1, "Opening in %s; slicing it and writing to CD/tape",3223 mr_msg(1, "Opening in %s; slicing it and writing to CD/tape", 3224 3224 file_to_openin); 3225 3225 if (!(fin = fopen(file_to_openin, "r"))) { … … 3279 3279 { 3280 3280 if (!does_file_exist(curr_slice_fname_uncompressed)) { 3281 log_msg(2,3281 mr_msg(2, 3282 3282 "Warning - '%s' doesn't exist. How can I compress slice?", 3283 3283 curr_slice_fname_uncompressed); … … 3287 3287 bkpinfo->compression_level, 3288 3288 curr_slice_fname_uncompressed); 3289 log_msg(2, command);3289 mr_msg(2, command); 3290 3290 if ((res = system(command))) { 3291 3291 log_OS_error(command); … … 3303 3303 retval += res; 3304 3304 if (res) { 3305 log_msg(2, "Failed to compress the slice");3305 mr_msg(2, "Failed to compress the slice"); 3306 3306 } 3307 3307 if (bkpinfo->use_lzo … … 3323 3323 newtRefresh(); 3324 3324 } else { 3325 log_msg(2, tmp);3325 mr_msg(2, tmp); 3326 3326 } 3327 3327 #else 3328 log_msg(2, tmp);3328 mr_msg(2, tmp); 3329 3329 #endif 3330 3330 mr_free(tmp); … … 3373 3373 biggie_file_number + 1); 3374 3374 } 3375 log_msg(1, tmp);3375 mr_msg(1, tmp); 3376 3376 mr_free(tmp); 3377 3377 return (retval); … … 3421 3421 mr_free(tmp); 3422 3422 3423 log_msg(1, "Wiped %s's archives", dir);3423 mr_msg(1, "Wiped %s's archives", dir); 3424 3424 mr_asprintf(&tmp, "ls -l %s", dir); 3425 3425 run_program_and_log_output(tmp, FALSE); … … 3457 3457 3458 3458 mr_asprintf(&tmp, "Writing the final ISO"); 3459 log_msg(2, tmp);3459 mr_msg(2, tmp); 3460 3460 /* BERLIOS: center_string is now broken 3461 3461 center_string(tmp, 80); … … 3473 3473 } 3474 3474 #endif 3475 log_msg(2, "Returning from writing final ISO (res=%d)", res);3475 mr_msg(2, "Returning from writing final ISO (res=%d)", res); 3476 3476 return (res); 3477 3477 } … … 3525 3525 using_nfs = FALSE; 3526 3526 } 3527 log_msg(1, "OK, time to make %s #%d",3527 mr_msg(1, "OK, time to make %s #%d", 3528 3528 bkpinfo->backup_media_string, 3529 3529 g_current_media_number); … … 3541 3541 bkpinfo->scratchdir); 3542 3542 if (run_program_and_log_output(tmp, FALSE)) { 3543 log_msg(2, "Warning - unable to copy autorun to scratchdir");3543 mr_msg(2, "Warning - unable to copy autorun to scratchdir"); 3544 3544 } 3545 3545 mr_free(tmp); … … 3550 3550 if (last_cd) { 3551 3551 unlink(lastcd_fname); 3552 log_msg(2,3552 mr_msg(2, 3553 3553 "OK, you're telling me this is the last CD. Fair enough."); 3554 3554 } else { … … 3579 3579 if ((tmp = find_cdrom_device(FALSE)) == NULL) // make sure find_cdrom_device() finds, records CD-R's loc 3580 3580 { 3581 log_msg(3, "*Sigh* Mike, I hate your computer.");3581 mr_msg(3, "*Sigh* Mike, I hate your computer."); 3582 3582 bkpinfo->manual_cd_tray = TRUE; 3583 3583 } // if it can't be found then force pausing 3584 3584 else { 3585 log_msg(3, "Great. Found Mike's CD-ROM drive.");3585 mr_msg(3, "Great. Found Mike's CD-ROM drive."); 3586 3586 mr_free(tmp); 3587 3587 } … … 3611 3611 } 3612 3612 } else { 3613 log_msg(2, "Retrying, at user's request...");3613 mr_msg(2, "Retrying, at user's request..."); 3614 3614 res = 0; 3615 3615 } … … 3634 3634 bkpinfo->scratchdir, bkpinfo->scratchdir); 3635 3635 if (system(tmp)) { 3636 log_msg(2,3636 mr_msg(2, 3637 3637 "Error occurred when I tried to delete the redundant IMGs and GZs"); 3638 3638 } … … 3640 3640 3641 3641 if (last_cd) { 3642 log_msg(2, "This was your last CD.");3643 } else { 3644 log_msg(2, "Continuing to backup your data...");3642 mr_msg(2, "This was your last CD."); 3643 } else { 3644 mr_msg(2, "Continuing to backup your data..."); 3645 3645 } 3646 3646 … … 3682 3682 //bkpinfo->backup_media_type == cdrw || bkpinfo->backup_media_type == cdr)) 3683 3683 { 3684 log_msg(2,3684 mr_msg(2, 3685 3685 "Not verifying again. Per-CD/ISO verification already carried out."); 3686 3686 paranoid_system … … 3694 3694 for (cdno = 1; cdno < 99 && bkpinfo->verify_data; cdno++) { 3695 3695 if (cdno != g_current_media_number) { 3696 log_msg(2,3696 mr_msg(2, 3697 3697 "Warning - had to change g_current_media_number from %d to %d", 3698 3698 g_current_media_number, cdno); … … 3787 3787 } 3788 3788 mr_asprintf(&tmp, "maxblocks = %d; p=%s", maxblocks, p); 3789 log_msg(2, tmp);3789 mr_msg(2, tmp); 3790 3790 mr_free(tmp); 3791 3791 … … 3803 3803 if (fread(blk, 1, 1024, fin) != 1024) { 3804 3804 if (feof(fin)) { 3805 log_msg(1,3805 mr_msg(1, 3806 3806 "img read err - img ended prematurely - non-fatal error"); 3807 3807 sleep(3);
Note:
See TracChangeset
for help on using the changeset viewer.