Changeset 2324 in MondoRescue for branches/2.2.10/mondo/src/common/libmondo-archive.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/common/libmondo-archive.c
r2323 r2324 202 202 203 203 if (!does_file_exist(filelist)) { 204 mr_asprintf(tmp, "(archive_this_fileset) - filelist %s does not exist", filelist); 205 log_to_screen(tmp); 206 paranoid_free(tmp); 204 log_to_screen("(archive_this_fileset) - filelist %s does not exist", filelist); 207 205 return (1); 208 206 } … … 210 208 mr_asprintf(tmp, "echo hi > %s 2> /dev/null", fname); 211 209 if (system(tmp)) { 212 paranoid_free(tmp);210 mr_free(tmp); 213 211 fatal_error("Unable to write tarball to scratchdir"); 214 212 } 215 213 paranoid_free(tmp); 216 214 217 mr_asprintf(command, "star H=star list=%s -c " STAR_ACL_SZ " file=%s", 218 filelist, fname); 215 mr_asprintf(command, "star H=star list=%s -c " STAR_ACL_SZ " file=%s", filelist, fname); 219 216 if (bkpinfo->use_lzo) { 217 mr_free(command); 220 218 fatal_error("Can't use lzop"); 221 219 } … … 237 235 res = 0; 238 236 } 239 paranoid_free(tmp);237 mr_free(tmp); 240 238 241 239 if (res) { … … 253 251 } 254 252 } 255 paranoid_free(command);253 mr_free(command); 256 254 257 255 retval += res; … … 309 307 310 308 if (!does_file_exist(filelist)) { 311 mr_asprintf(tmp, "(archive_this_fileset) - filelist %s does not exist", 312 filelist); 313 log_to_screen(tmp); 314 paranoid_free(tmp); 309 log_to_screen("(archive_this_fileset) - filelist %s does not exist", filelist); 315 310 return (1); 316 311 } 317 312 mr_asprintf(tmp, "echo hi > %s 2> /dev/null", fname); 318 313 if (system(tmp)) { 319 paranoid_free(tmp);314 mr_free(tmp); 320 315 fatal_error("Unable to write tarball to scratchdir"); 321 316 } 322 paranoid_free(tmp);317 mr_free(tmp); 323 318 324 319 … … 326 321 mr_asprintf(tmp, "%s/do-not-compress-these", g_mondo_home); 327 322 // -b %ld, TAPE_BLOCK_SIZE 328 mr_asprintf(zipparams, "-Z -P %s -G %d -T 3k", bkpinfo->zip_exe, 329 bkpinfo->compression_level); 323 mr_asprintf(zipparams, "-Z -P %s -G %d -T 3k", bkpinfo->zip_exe, bkpinfo->compression_level); 330 324 if (does_file_exist(tmp)) { 331 325 mr_strcat(zipparams, " -E %s",tmp); … … 333 327 log_msg(3, "%s not found. Cannot exclude zipfiles, etc.", tmp); 334 328 } 335 paranoid_free(tmp);329 mr_free(tmp); 336 330 } else { 337 331 mr_asprintf(zipparams, ""); … … 346 340 fatal_error("scratchdir not found"); 347 341 } 348 mr_asprintf(command, "rm -f %s %s. %s.gz %s.%s", fname, fname, fname, 349 fname, bkpinfo->zip_suffix); 342 mr_asprintf(command, "rm -f %s %s. %s.gz %s.%s", fname, fname, fname, fname, bkpinfo->zip_suffix); 350 343 paranoid_system(command); 351 paranoid_free(command);344 mr_free(command); 352 345 353 346 mr_asprintf(command, "afio -o -b %ld -M 16m %s %s < %s 2>> %s", TAPE_BLOCK_SIZE, zipparams, fname, filelist, MONDO_LOGFILE); 354 paranoid_free(zipparams);347 mr_free(zipparams); 355 348 356 349 mr_asprintf(tmp, "echo hi > %s 2> /dev/null", fname); 357 350 if (system(tmp)) { 358 paranoid_free(tmp);351 mr_free(tmp); 359 352 fatal_error("Unable to write tarball to scratchdir"); 360 353 } 361 paranoid_free(tmp);354 mr_free(tmp); 362 355 363 356 for (res = 99, tries = 0; tries < 3 && res != 0; tries++) { … … 545 538 mr_free(tmp); 546 539 547 mr_asprintf(tmp, "devs_to_exclude = '%s'", devs_to_exclude); 548 log_msg(2, tmp); 549 mr_free(tmp); 540 log_msg(2, "devs_to_exclude = '%s'", devs_to_exclude); 550 541 } 551 542 … … 557 548 mr_asprintf(tmp, "%s/tmpfs/filelist.full", bkpinfo->tmpdir); 558 549 if (!does_file_exist(tmp)) { 559 fatal_error560 550 mr_free(tmp); 551 fatal_error ("Cannot find filelist.full, so I cannot count its lines"); 561 552 } 562 553 } … … 623 614 624 615 #ifdef __FreeBSD__ 625 mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output 626 ("mount | grep ' /boot ' | head -1 | cut -d' ' -f1 | sed 's/\\([0-9]\\).*/\\1/'")); 616 mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output("mount | grep ' /boot ' | head -1 | cut -d' ' -f1 | sed 's/\\([0-9]\\).*/\\1/'")); 627 617 if (!bootdev[0]) { 628 618 mr_free(bootdev); 629 mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output 630 ("mount | grep ' / ' | head -1 | cut -d' ' -f1 | sed 's/\\([0-9]\\).*/\\1/'")); 619 mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output("mount | grep ' / ' | head -1 | cut -d' ' -f1 | sed 's/\\([0-9]\\).*/\\1/'")); 631 620 } 632 621 #else 633 622 /* Linux */ 634 623 #ifdef __IA64__ 635 mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output 636 ("mount | grep ' /boot/efi ' | head -1 | cut -d' ' -f1 | sed 's/[0-9].*//'")); 624 mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output("mount | grep ' /boot/efi ' | head -1 | cut -d' ' -f1 | sed 's/[0-9].*//'")); 637 625 #else 638 mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output 639 ("mount | grep ' /boot ' | head -1 | cut -d' ' -f1 | sed 's/[0-9].*//'")); 626 mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output("mount | grep ' /boot ' | head -1 | cut -d' ' -f1 | sed 's/[0-9].*//'")); 640 627 #endif 641 628 if (strstr(bootdev, "/dev/cciss/")) { 642 629 mr_free(bootdev); 643 630 #ifdef __IA64__ 644 mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output 645 ("mount | grep ' /boot/efi ' | head -1 | cut -d' ' -f1 | cut -dp -f1")); 631 mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output("mount | grep ' /boot/efi ' | head -1 | cut -d' ' -f1 | cut -dp -f1")); 646 632 #else 647 mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output 648 ("mount | grep ' /boot ' | head -1 | cut -d' ' -f1 | cut -dp -f1")); 633 mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output("mount | grep ' /boot ' | head -1 | cut -d' ' -f1 | cut -dp -f1")); 649 634 #endif 650 635 } 651 636 if (!bootdev[0]) { 652 637 mr_free(bootdev); 653 mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output 654 ("mount | grep ' / ' | head -1 | cut -d' ' -f1 | sed 's/[0-9].*//'")); 638 mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output("mount | grep ' / ' | head -1 | cut -d' ' -f1 | sed 's/[0-9].*//'")); 655 639 if (strstr(bootdev, "/dev/cciss/")) { 656 640 mr_free(bootdev); 657 mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output 658 ("mount | grep ' / ' | head -1 | cut -d' ' -f1 | cut -dp -f1")); 641 mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output("mount | grep ' / ' | head -1 | cut -d' ' -f1 | cut -dp -f1")); 659 642 } 660 643 } … … 666 649 ch = 'U'; 667 650 if (bkpinfo->boot_loader != '\0') { 668 mr_asprintf(tmp, "User specified boot loader. It is '%c'.", bkpinfo->boot_loader); 669 log_msg(2, tmp); 670 mr_free(tmp); 651 log_msg(2, "User specified boot loader. It is '%c'.", bkpinfo->boot_loader); 671 652 } else { 672 653 bkpinfo->boot_loader = ch; 673 654 } 674 655 if (bkpinfo->boot_device[0] != '\0') { 675 mr_asprintf(tmp, "User specified boot device. It is '%s'.", bkpinfo->boot_device); 676 log_msg(2, tmp); 677 mr_free(tmp); 656 log_msg(2, "User specified boot device. It is '%s'.", bkpinfo->boot_device); 678 657 } else { 679 658 strcpy(bkpinfo->boot_device, bootdev); … … 698 677 mr_asprintf(bootldr_str, "LILO"); 699 678 if (!does_file_exist("/etc/lilo.conf")) { 700 fatal_error 701 ("The de facto standard location for your boot loader's config file is /etc/lilo.conf but I cannot find it there. What is wrong with your Linux distribution?"); 679 fatal_error("The de facto standard location for your boot loader's config file is /etc/lilo.conf but I cannot find it there. What is wrong with your Linux distribution?"); 702 680 } 703 681 } else if (bkpinfo->boot_loader == 'G') { 704 682 mr_asprintf(bootldr_str, "GRUB"); 705 if (!does_file_exist("/boot/grub/menu.lst") 706 && does_file_exist("/boot/grub/grub.conf")) { 707 run_program_and_log_output 708 ("ln -sf /boot/grub/grub.conf /boot/grub/menu.lst", 5); 683 if (!does_file_exist("/boot/grub/menu.lst") && does_file_exist("/boot/grub/grub.conf")) { 684 run_program_and_log_output("ln -sf /boot/grub/grub.conf /boot/grub/menu.lst", 5); 709 685 } 710 686 if (!does_file_exist("/boot/grub/menu.lst")) { 711 fatal_error 712 ("The de facto standard location for your boot loader's config file is /boot/grub/menu.lst but I cannot find it there. What is wrong with your Linux distribution?"); 687 fatal_error("The de facto standard location for your boot loader's config file is /boot/grub/menu.lst but I cannot find it there. What is wrong with your Linux distribution?"); 713 688 } 714 689 } else if (bkpinfo->boot_loader == 'E') { 715 690 mr_asprintf(bootldr_str, "ELILO"); 716 691 /* BCO: fix it for Debian, Mandrake, ... */ 717 if (!does_file_exist("/etc/elilo.conf") 718 && does_file_exist("/boot/efi/efi/redhat/elilo.conf")) { 719 run_program_and_log_output 720 ("ln -sf /boot/efi/efi/redhat/elilo.conf /etc/elilo.conf", 721 5); 722 } 723 if (!does_file_exist("/etc/elilo.conf") 724 && does_file_exist("/boot/efi/efi/SuSE/elilo.conf")) { 725 run_program_and_log_output 726 ("ln -sf /boot/efi/efi/SuSE/elilo.conf /etc/elilo.conf", 727 5); 728 } 729 if (!does_file_exist("/etc/elilo.conf") 730 && does_file_exist("/boot/efi/efi/debian/elilo.conf")) { 731 run_program_and_log_output 732 ("ln -sf /boot/efi/efi/debian/elilo.conf /etc/elilo.conf", 733 5); 734 } 735 if (!does_file_exist("/etc/elilo.conf") 736 && does_file_exist("/boot/efi/debian/elilo.conf")) { 737 run_program_and_log_output 738 ("ln -sf /boot/efi/debian/elilo.conf /etc/elilo.conf", 739 5); 692 if (!does_file_exist("/etc/elilo.conf") && does_file_exist("/boot/efi/efi/redhat/elilo.conf")) { 693 run_program_and_log_output("ln -sf /boot/efi/efi/redhat/elilo.conf /etc/elilo.conf", 5); 694 } 695 if (!does_file_exist("/etc/elilo.conf") && does_file_exist("/boot/efi/efi/SuSE/elilo.conf")) { 696 run_program_and_log_output("ln -sf /boot/efi/efi/SuSE/elilo.conf /etc/elilo.conf", 5); 697 } 698 if (!does_file_exist("/etc/elilo.conf") && does_file_exist("/boot/efi/efi/debian/elilo.conf")) { 699 run_program_and_log_output ("ln -sf /boot/efi/efi/debian/elilo.conf /etc/elilo.conf", 5); 700 } 701 if (!does_file_exist("/etc/elilo.conf") && does_file_exist("/boot/efi/debian/elilo.conf")) { 702 run_program_and_log_output ("ln -sf /boot/efi/debian/elilo.conf /etc/elilo.conf", 5); 740 703 } 741 704 if (!does_file_exist("/etc/elilo.conf")) { 742 fatal_error 743 ("The de facto mondo standard location for your boot loader's config file is /etc/elilo.conf but I cannot find it there. What is wrong with your Linux distribution? Try finding it under /boot/efi and do 'ln -s /boot/efi/..../elilo.conf /etc/elilo.conf'"); 705 fatal_error("The de facto mondo standard location for your boot loader's config file is /etc/elilo.conf but I cannot find it there. What is wrong with your Linux distribution? Try finding it under /boot/efi and do 'ln -s /boot/efi/..../elilo.conf /etc/elilo.conf'"); 744 706 } 745 707 } else if (bkpinfo->boot_loader == 'R') { … … 758 720 mr_asprintf(bootldr_str, "unknown"); 759 721 } 760 mr_asprintf(tmp, "Your boot loader is %s and it boots from %s", bootldr_str, bkpinfo->boot_device); 761 log_to_screen(tmp); 762 mr_free(tmp); 722 log_to_screen("Your boot loader is %s and it boots from %s", bootldr_str, bkpinfo->boot_device); 763 723 764 724 mr_asprintf(tmp, "%s/BOOTLOADER.DEVICE", bkpinfo->tmpdir); … … 808 768 if (write_one_liner_data_file(tmp, value)) { 809 769 res++; 810 log_msg(1, "%ld: Unable to write one-liner backup-media-type", 811 __LINE__); 770 log_msg(1, "%ld: Unable to write one-liner backup-media-type", __LINE__); 812 771 } 813 772 mr_free(value); … … 817 776 if (write_one_liner_data_file(tmp, bootldr_str)) { 818 777 res++; 819 log_msg(1, "%ld: Unable to write one-liner bootloader.name", 820 __LINE__); 778 log_msg(1, "%ld: Unable to write one-liner bootloader.name", __LINE__); 821 779 } 822 780 mr_free(bootldr_str); … … 837 795 __LINE__); 838 796 } 839 paranoid_free(tmp1);797 mr_free(tmp1); 840 798 } 841 799 if (g_getfacl) { 842 800 mr_asprintf(tmp1, "%s/ACL", bkpinfo->tmpdir); 843 801 if (write_one_liner_data_file(tmp1, "TRUE")) { 844 log_msg(1, "%ld: Unable to write one-liner ACL", 845 __LINE__); 846 } 847 paranoid_free(tmp1); 802 log_msg(1, "%ld: Unable to write one-liner ACL", __LINE__); 803 } 804 mr_free(tmp1); 848 805 } 849 806 if (bkpinfo->use_obdr) { 850 807 mr_asprintf(tmp1, "%s/OBDR", bkpinfo->tmpdir); 851 808 if (write_one_liner_data_file(tmp1, "TRUE")) { 852 log_msg(1, "%ld: Unable to write one-liner OBDR", 853 __LINE__); 854 } 855 paranoid_free(tmp1); 809 log_msg(1, "%ld: Unable to write one-liner OBDR", __LINE__); 810 } 811 mr_free(tmp1); 856 812 } 857 813 858 814 estimated_total_noof_slices = 859 815 size_of_all_biggiefiles_K(bkpinfo) / bkpinfo->optimal_set_size + 1; 860 /* add nfs stuff here? */816 /* BERLIOS: add nfs stuff here? */ 861 817 mr_asprintf(command, "mkdir -p %s/images", bkpinfo->scratchdir); 862 818 if (system(command)) { … … 867 823 log_msg(1, "lines_in_filelist = %ld", lines_in_filelist); 868 824 869 mr_asprintf(command,870 825 /* "mindi --custom 2=%s 3=%s/images 4=\"%s\" 5=\"%s\" \ 871 826 6=\"%s\" 7=%ld 8=\"%s\" 9=\"%s\" 10=\"%s\" \ 872 827 11=\"%s\" 12=%s 13=%ld 14=\"%s\" 15=\"%s\" 16=\"%s\" 17=\"%s\" 18=%ld 19=%d",*/ 873 mr_asprintf(&command, "mindi %s --custom %s %s/images '%s' '%s' \ 874 '%s' %ld '%s' '%s' '%s' \ 828 mr_asprintf(command, "mindi %s --custom %s %s/images '%s' '%s' '%s' %ld '%s' '%s' '%s' \ 875 829 '%s' %s %ld '%s' '%s' '%s' '%s' %ld %d '%s'", tmp2, bkpinfo->tmpdir, // parameter #2 876 830 bkpinfo->scratchdir, // parameter #3 … … 923 877 log_msg(2, command); 924 878 run_program_and_log_output(command, FALSE); 925 paranoid_free(command);879 mr_free(command); 926 880 927 881 if (bkpinfo->nonbootable_backup) { 928 882 mr_asprintf(command, "cp -f %s/all.tar.gz %s/images", bkpinfo->tmpdir, bkpinfo->scratchdir); 929 883 if (system(command)) { 930 paranoid_free(command);884 mr_free(command); 931 885 fatal_error("Unable to create temporary all tarball"); 932 886 } 933 paranoid_free(command);887 mr_free(command); 934 888 } 935 889 /* For USB we already have everything on the key */ … … 937 891 mr_asprintf(command, "rm -rf %s/images", bkpinfo->scratchdir); 938 892 run_program_and_log_output(command, FALSE); 939 paranoid_free(command);893 mr_free(command); 940 894 } else { 941 895 mr_asprintf(tmp, "cp -f %s/images/all.tar.gz %s", bkpinfo->scratchdir, bkpinfo->tmpdir); 942 896 if (system(tmp)) { 897 mr_free(tmp); 943 898 fatal_error("Cannot find all.tar.gz in tmpdir"); 944 899 } … … 954 909 mr_asprintf(command, "grep 'Fatal error' /var/log/mindi.log"); 955 910 mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output(command)); 956 paranoid_free(command);911 mr_free(command); 957 912 958 913 if (strlen(tmp) > 1) { … … 1092 1047 1093 1048 if (res) { 1094 mr_asprintf(tmp, "Errors occurred while archiving set %ld. Please review logs.", archiving_set_no); 1095 log_to_screen(tmp); 1096 mr_free(tmp); 1049 log_to_screen("Errors occurred while archiving set %ld. Please review logs.", archiving_set_no); 1097 1050 } 1098 1051 if (!semaphore_p()) { … … 1470 1423 mr_free(media_usage_comment); 1471 1424 if (res) { 1472 mr_asprintf(tmp, "Failed to add archive %ld's files to CD dir\n", storing_set_no); 1473 log_to_screen(tmp); 1474 paranoid_free(tmp); 1475 fatal_error 1476 ("Is your hard disk full? If not, please send the author the logfile."); 1425 log_to_screen("Failed to add archive %ld's files to CD dir\n", storing_set_no); 1426 fatal_error("Is your hard disk full? If not, please send the author the logfile."); 1477 1427 } 1478 1428 storing_set_no++; … … 1504 1454 } 1505 1455 log_to_screen(tmp); 1506 paranoid_free(tmp);1456 mr_free(tmp); 1507 1457 1508 1458 paranoid_free(transfer_block); … … 1558 1508 mr_asprintf(tmp, "chmod 755 %s", bkpinfo->scratchdir); 1559 1509 run_program_and_log_output(tmp, FALSE); 1560 paranoid_free(tmp);1510 mr_free(tmp); 1561 1511 (void)chdir(bkpinfo->scratchdir); 1562 1512 … … 1571 1521 mr_asprintf(tmp, "umount %s", tmp1); 1572 1522 run_program_and_log_output(tmp, FALSE); 1573 paranoid_free(tmp);1574 } 1575 paranoid_free(tmp);1523 mr_free(tmp); 1524 } 1525 mr_free(tmp1); 1576 1526 1577 1527 log_msg(1, "Mounting USB device."); … … 1579 1529 mr_asprintf(tmp, "mkdir -p %s", tmp1); 1580 1530 run_program_and_log_output(tmp, FALSE); 1581 paranoid_free(tmp); 1531 mr_free(tmp); 1532 1582 1533 /* Mindi always create one single parition on the USB dev */ 1583 1534 mr_asprintf(tmp, "mount %s1 %s", bkpinfo->media_device, tmp1); 1584 1535 run_program_and_log_output(tmp, FALSE); 1585 paranoid_free(tmp);1536 mr_free(tmp); 1586 1537 1587 1538 if (bkpinfo->nonbootable_backup) { … … 1599 1550 } 1600 1551 log_to_screen(result_sz); 1601 paranoid_free(result_sz);1602 paranoid_free(tmp);1552 mr_free(result_sz); 1553 mr_free(tmp); 1603 1554 retval += res; 1604 1555 … … 1606 1557 mr_asprintf(tmp,"mkdir %s/archive", bkpinfo->scratchdir); 1607 1558 run_program_and_log_output(tmp, FALSE); 1608 paranoid_free(tmp);1559 mr_free(tmp); 1609 1560 } 1610 1561 paranoid_free(message_to_screen); … … 1614 1565 mr_asprintf(tmp, "umount %s1", bkpinfo->media_device); 1615 1566 run_program_and_log_output(tmp, FALSE); 1616 paranoid_free(tmp);1567 mr_free(tmp); 1617 1568 } 1618 1569 … … 1695 1646 if (bkpinfo->call_before_iso[0] != '\0') { 1696 1647 mr_asprintf(message_to_screen, "Running pre-ISO call for CD#%d", g_current_media_number); 1697 res = 1698 eval_call_to_make_ISO(bkpinfo->call_before_iso, 1699 destfile, g_current_media_number, 1700 MONDO_LOGFILE, message_to_screen); 1648 res = eval_call_to_make_ISO(bkpinfo->call_before_iso, destfile, g_current_media_number, MONDO_LOGFILE, message_to_screen); 1701 1649 if (res) { 1702 1650 mr_strcat(message_to_screen, "...failed"); … … 2015 1963 log_to_screen(tmp); 2016 1964 noof_biggie_files = count_lines_in_file(biggielist_fname); 2017 open_progress_form("Backing up big files", tmp, 2018 "Please wait. This may take some time.", "", 2019 estimated_total_noof_slices); 2020 paranoid_free(tmp); 1965 open_progress_form("Backing up big files", tmp, "Please wait. This may take some time.", "", estimated_total_noof_slices); 1966 mr_free(tmp); 2021 1967 2022 1968 if (!(fin = fopen(biggielist_fname, "r"))) { … … 2127 2073 } 2128 2074 #endif 2129 paranoid_free(tmp);2075 mr_free(tmp); 2130 2076 } 2131 2077 log_msg(1, "Finished backing up bigfiles"); … … 2195 2141 retval += res; 2196 2142 if (res) { 2197 mr_asprintf(tmp, "Errors occurred while archiving set %ld. Perhaps your live filesystem changed?", curr_set_no); 2198 log_to_screen(tmp); 2199 mr_free(tmp); 2143 log_to_screen("Errors occurred while archiving set %ld. Perhaps your live filesystem changed?", curr_set_no); 2200 2144 } 2201 2145 … … 2247 2191 2248 2192 if (res) { 2249 mr_asprintf(tmp, "Failed to add archive %ld's files to CD dir\n", curr_set_no); 2250 log_to_screen(tmp); 2251 mr_free(tmp); 2252 fatal_error 2253 ("Is your hard disk is full? If not, please send the author the logfile."); 2193 log_to_screen("Failed to add archive %ld's files to CD dir\n", curr_set_no); 2194 fatal_error("Is your hard disk is full? If not, please send the author the logfile."); 2254 2195 } 2255 2196 mr_free(curr_filelist_fname); … … 2682 2623 2683 2624 mds = media_descriptor_string(g_backup_media_type); 2684 mr_asprintf(tmp,"I am about to burn %s #%d", mds, g_current_media_number);2625 log_to_screen("I am about to burn %s #%d", mds, g_current_media_number); 2685 2626 mr_free(mds); 2686 log_to_screen(tmp);2687 mr_free(tmp);2688 2627 if (g_current_media_number < ask_for_one_if_more_than_this) { 2689 2628 return; … … 2993 2932 if (!(fin = fopen(file_to_openin, "r"))) { 2994 2933 log_OS_error("Unable to openin biggie_filename"); 2995 mr_asprintf(tmp, "Cannot archive bigfile '%s': not found", biggie_filename); 2996 log_to_screen(tmp); 2997 paranoid_free(tmp); 2934 log_to_screen("Cannot archive bigfile '%s': not found", biggie_filename); 2998 2935 2999 2936 paranoid_free(checksum_line); … … 3115 3052 retval += res; 3116 3053 if (res) { 3117 mr_asprintf(tmp, "Failed to add slice %ld of bigfile %ld to scratchdir", slice_num, biggie_file_number + 1); 3118 log_to_screen(tmp); 3119 paranoid_free(tmp); 3120 fatal_error 3121 ("Hard disk full. You should have bought a bigger one."); 3054 log_to_screen("Failed to add slice %ld of bigfile %ld to scratchdir", slice_num, biggie_file_number + 1); 3055 fatal_error("Hard disk full. You should have bought a bigger one."); 3122 3056 } 3123 3057 } … … 3132 3066 } 3133 3067 log_msg(1, tmp); 3134 paranoid_free(tmp);3068 mr_free(tmp); 3135 3069 3136 3070 paranoid_free(checksum_line); … … 3310 3244 if (space_occupied_by_cd(bkpinfo->scratchdir) / 1024 > 3311 3245 bkpinfo->media_size[g_current_media_number]) { 3312 mr_asprintf(tmp1, "Warning! CD is too big. It occupies %ld KB, which is more than the %ld KB allowed.", (long) space_occupied_by_cd(bkpinfo->scratchdir), (long) bkpinfo->media_size[g_current_media_number]); 3313 log_to_screen(tmp1); 3314 mr_free(tmp1); 3246 log_to_screen("Warning! CD is too big. It occupies %ld KB, which is more than the %ld KB allowed.", (long) space_occupied_by_cd(bkpinfo->scratchdir), (long) bkpinfo->media_size[g_current_media_number]); 3315 3247 } 3316 3248 mr_asprintf(isofile, "%s/%s/%s-%d.iso", bkpinfo->isodir, bkpinfo->nfs_remote_dir, bkpinfo->prefix, g_current_media_number); … … 3377 3309 mr_asprintf(tmp1, "rm -Rf %s/images/*gz %s/images/*data*img", bkpinfo->scratchdir, bkpinfo->scratchdir); 3378 3310 if (system(tmp1)) { 3379 log_msg 3380 (2, 3381 "Error occurred when I tried to delete the redundant IMGs and GZs"); 3311 log_msg(2, "Error occurred when I tried to delete the redundant IMGs and GZs"); 3382 3312 } 3383 3313 mr_free(tmp1); … … 3455 3385 if (res) { 3456 3386 mds = media_descriptor_string(bkpinfo->backup_media_type); 3457 mr_asprintf(tmp,"Warnings/errors were reported while checking %s #%d", mds, g_current_media_number);3387 log_to_screen("Warnings/errors were reported while checking %s #%d", mds, g_current_media_number); 3458 3388 mr_free(mds); 3459 log_to_screen(tmp);3460 mr_free(tmp);3461 3389 3462 3390 }
Note:
See TracChangeset
for help on using the changeset viewer.