Changeset 3185 in MondoRescue for branches/3.0/mondo/src/common/libmondo-archive.c
- Timestamp:
- Sep 20, 2013, 2:29:57 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.0/mondo/src/common/libmondo-archive.c
r3150 r3185 200 200 201 201 if (!does_file_exist(filelist)) { 202 mr_asprintf( &tmp, "(archive_this_fileset) - filelist %s does not exist", filelist);202 mr_asprintf(tmp, "(archive_this_fileset) - filelist %s does not exist", filelist); 203 203 log_to_screen(tmp); 204 204 paranoid_free(tmp); … … 206 206 } 207 207 208 mr_asprintf( &tmp, "echo hi > %s 2> /dev/null", fname);208 mr_asprintf(tmp, "echo hi > %s 2> /dev/null", fname); 209 209 if (system(tmp)) { 210 210 paranoid_free(tmp); … … 213 213 paranoid_free(tmp); 214 214 215 mr_asprintf( &command, "star H=exustar list=%s -c -sparse " STAR_ACL_SZ " file=%s",215 mr_asprintf(command, "star H=exustar list=%s -c -sparse " STAR_ACL_SZ " file=%s", 216 216 filelist, fname); 217 217 if (bkpinfo->use_lzo) { … … 227 227 log_msg(5, "command='%s'", command); 228 228 res = system(command); 229 mr_asprintf( &tmp, "%s", last_line_of_file(MONDO_LOGFILE));229 mr_asprintf(tmp, "%s", last_line_of_file(MONDO_LOGFILE)); 230 230 log_msg(1, "res=%d; tmp='%s'", res, tmp); 231 231 if (bkpinfo->use_star && (res == 254 || res == 65024) … … 307 307 308 308 if (!does_file_exist(filelist)) { 309 mr_asprintf( &tmp, "(archive_this_fileset) - filelist %s does not exist",309 mr_asprintf(tmp, "(archive_this_fileset) - filelist %s does not exist", 310 310 filelist); 311 311 log_to_screen(tmp); … … 313 313 return (1); 314 314 } 315 mr_asprintf( &tmp, "echo hi > %s 2> /dev/null", fname);315 mr_asprintf(tmp, "echo hi > %s 2> /dev/null", fname); 316 316 if (system(tmp)) { 317 317 paranoid_free(tmp); … … 322 322 323 323 if (bkpinfo->compression_level > 0) { 324 mr_asprintf( &tmp, "%s/do-not-compress-these", g_mondo_home);324 mr_asprintf(tmp, "%s/do-not-compress-these", g_mondo_home); 325 325 // -b %ld, TAPE_BLOCK_SIZE 326 mr_asprintf( &zipparams, "-Z -P %s -G %d -T 3k", bkpinfo->zip_exe,326 mr_asprintf(zipparams, "-Z -P %s -G %d -T 3k", bkpinfo->zip_exe, 327 327 bkpinfo->compression_level); 328 328 if (does_file_exist(tmp)) { … … 333 333 paranoid_free(tmp); 334 334 } else { 335 mr_asprintf( &zipparams, "");335 mr_asprintf(zipparams, ""); 336 336 } 337 337 … … 346 346 fatal_error("scratchdir not found"); 347 347 } 348 mr_asprintf( &command, "rm -f %s %s. %s.gz %s.%s", fname, fname, fname,348 mr_asprintf(command, "rm -f %s %s. %s.gz %s.%s", fname, fname, fname, 349 349 fname, bkpinfo->zip_suffix); 350 350 paranoid_system(command); 351 351 paranoid_free(command); 352 352 353 mr_asprintf( &command, "afio -o -b %ld -M 16m %s %s < %s 2>> %s",353 mr_asprintf(command, "afio -o -b %ld -M 16m %s %s < %s 2>> %s", 354 354 TAPE_BLOCK_SIZE, zipparams, fname, filelist, MONDO_LOGFILE); 355 355 paranoid_free(zipparams); 356 356 357 mr_asprintf( &tmp, "echo hi > %s 2> /dev/null", fname);357 mr_asprintf(tmp, "echo hi > %s 2> /dev/null", fname); 358 358 if (system(tmp)) { 359 359 paranoid_free(tmp); … … 545 545 "Calling MINDI to create boot+data disks"); 546 546 open_evalcall_form("Calling MINDI to create boot+data disks"); 547 mr_asprintf( &tmp, "%s/filelist.full", bkpinfo->tmpdir);547 mr_asprintf(tmp, "%s/filelist.full", bkpinfo->tmpdir); 548 548 if (!does_file_exist(tmp)) { 549 549 mr_free(tmp); 550 mr_asprintf( &tmp, "%s/tmpfs/filelist.full", bkpinfo->tmpdir);550 mr_asprintf(tmp, "%s/tmpfs/filelist.full", bkpinfo->tmpdir); 551 551 if (!does_file_exist(tmp)) { 552 552 fatal_error … … 557 557 mr_free(tmp); 558 558 559 mr_asprintf( &tmp, "%s/LAST-FILELIST-NUMBER", bkpinfo->tmpdir);560 mr_asprintf( &last_filelist_number, "%s", last_line_of_file(tmp));559 mr_asprintf(tmp, "%s/LAST-FILELIST-NUMBER", bkpinfo->tmpdir); 560 mr_asprintf(last_filelist_number, "%s", last_line_of_file(tmp)); 561 561 mr_free(tmp); 562 562 563 563 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) { 564 mr_asprintf( &tape_size_sz, "%ld", bkpinfo->media_size);564 mr_asprintf(tape_size_sz, "%ld", bkpinfo->media_size); 565 565 ntapedev = get_non_rewind_dev(bkpinfo->media_device); 566 566 if ((bkpinfo->use_obdr) && (ntapedev != NULL)) { … … 572 572 } 573 573 paranoid_free(ntapedev); 574 mr_asprintf( &tape_device, "%s", bkpinfo->media_device);574 mr_asprintf(tape_device, "%s", bkpinfo->media_device); 575 575 } else { 576 mr_asprintf( &tape_size_sz, "%ld", 0L);;577 mr_asprintf( &tape_device, "");576 mr_asprintf(tape_size_sz, "%ld", 0L);; 577 mr_asprintf(tape_device, ""); 578 578 } 579 579 if (bkpinfo->use_lzo) { 580 mr_asprintf( &use_lzo_sz, "yes");580 mr_asprintf(use_lzo_sz, "yes"); 581 581 } else { 582 mr_asprintf( &use_lzo_sz, "no");582 mr_asprintf(use_lzo_sz, "no"); 583 583 } 584 584 if (bkpinfo->use_gzip) { 585 mr_asprintf( &use_gzip_sz, "yes");585 mr_asprintf(use_gzip_sz, "yes"); 586 586 } else { 587 mr_asprintf( &use_gzip_sz, "no");587 mr_asprintf(use_gzip_sz, "no"); 588 588 } 589 589 if (bkpinfo->use_star) { 590 mr_asprintf( &use_star_sz, "yes");590 mr_asprintf(use_star_sz, "yes"); 591 591 } else { 592 mr_asprintf( &use_star_sz, "no");592 mr_asprintf(use_star_sz, "no"); 593 593 } 594 594 595 595 if (bkpinfo->compression_level > 0) { 596 mr_asprintf( &use_comp_sz, "yes");596 mr_asprintf(use_comp_sz, "yes"); 597 597 } else { 598 mr_asprintf( &use_comp_sz, "no");599 } 600 601 mr_asprintf( &broken_bios_sz, "yes"); /* assume so */598 mr_asprintf(use_comp_sz, "no"); 599 } 600 601 mr_asprintf(broken_bios_sz, "yes"); /* assume so */ 602 602 if (g_cd_recovery) { 603 mr_asprintf( &cd_recovery_sz, "yes");603 mr_asprintf(cd_recovery_sz, "yes"); 604 604 } else { 605 mr_asprintf( &cd_recovery_sz, "no");605 mr_asprintf(cd_recovery_sz, "no"); 606 606 } 607 607 if (bkpinfo->make_cd_use_lilo) { 608 mr_asprintf( &use_lilo_sz, "yes");608 mr_asprintf(use_lilo_sz, "yes"); 609 609 } else { 610 mr_asprintf( &use_lilo_sz, "no");610 mr_asprintf(use_lilo_sz, "no"); 611 611 } 612 612 … … 617 617 618 618 #ifdef __FreeBSD__ 619 mr_asprintf( &bootdev, "%s", call_program_and_get_last_line_of_output619 mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output 620 620 ("mount | grep ' /boot ' | head -1 | cut -d' ' -f1 | sed 's/\\([0-9]\\).*/\\1/'")); 621 621 if (!bootdev[0]) { 622 622 mr_free(bootdev); 623 mr_asprintf( &bootdev, "%s", call_program_and_get_last_line_of_output623 mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output 624 624 ("mount | grep ' / ' | head -1 | cut -d' ' -f1 | sed 's/\\([0-9]\\).*/\\1/'")); 625 625 } … … 627 627 /* Linux */ 628 628 #ifdef __IA64__ 629 mr_asprintf( &bootdev, "%s", call_program_and_get_last_line_of_output629 mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output 630 630 ("mount | grep ' /boot/efi ' | head -1 | cut -d' ' -f1 | sed 's/[0-9].*//'")); 631 631 #else 632 mr_asprintf( &bootdev, "%s", call_program_and_get_last_line_of_output632 mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output 633 633 ("mount | grep ' /boot ' | head -1 | cut -d' ' -f1 | sed 's/[0-9].*//'")); 634 634 #endif … … 636 636 mr_free(bootdev); 637 637 #ifdef __IA64__ 638 mr_asprintf( &bootdev, "%s", call_program_and_get_last_line_of_output638 mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output 639 639 ("mount | grep ' /boot/efi ' | head -1 | cut -d' ' -f1 | cut -dp -f1")); 640 640 #else 641 mr_asprintf( &bootdev, "%s", call_program_and_get_last_line_of_output641 mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output 642 642 ("mount | grep ' /boot ' | head -1 | cut -d' ' -f1 | cut -dp -f1")); 643 643 #endif … … 645 645 if (!bootdev[0]) { 646 646 mr_free(bootdev); 647 mr_asprintf( &bootdev, "%s", call_program_and_get_last_line_of_output647 mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output 648 648 ("mount | grep ' / ' | head -1 | cut -d' ' -f1 | sed 's/[0-9].*//'")); 649 649 if (strstr(bootdev, "/dev/cciss/")) { 650 650 mr_free(bootdev); 651 mr_asprintf( &bootdev, "%s", call_program_and_get_last_line_of_output651 mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output 652 652 ("mount | grep ' / ' | head -1 | cut -d' ' -f1 | cut -dp -f1")); 653 653 } … … 660 660 ch = 'U'; 661 661 if (bkpinfo->boot_loader != '\0') { 662 mr_asprintf( &tmp, "User specified boot loader. It is '%c'.", bkpinfo->boot_loader);662 mr_asprintf(tmp, "User specified boot loader. It is '%c'.", bkpinfo->boot_loader); 663 663 log_msg(2, tmp); 664 664 mr_free(tmp); … … 667 667 } 668 668 if (bkpinfo->boot_device[0] != '\0') { 669 mr_asprintf( &tmp, "User specified boot device. It is '%s'.", bkpinfo->boot_device);669 mr_asprintf(tmp, "User specified boot device. It is '%s'.", bkpinfo->boot_device); 670 670 log_msg(2, tmp); 671 671 mr_free(tmp); … … 690 690 } 691 691 if (bkpinfo->boot_loader == 'L') { 692 mr_asprintf( &bootldr_str, "LILO");692 mr_asprintf(bootldr_str, "LILO"); 693 693 if (!does_file_exist("/etc/lilo.conf")) { 694 694 fatal_error … … 696 696 } 697 697 } else if (bkpinfo->boot_loader == 'G') { 698 mr_asprintf( &bootldr_str, "GRUB");698 mr_asprintf(bootldr_str, "GRUB"); 699 699 if (!does_file_exist("/boot/grub/menu.lst") 700 700 && does_file_exist("/boot/grub/grub.conf")) { … … 706 706 ("The de facto standard location for your boot loader's config file is /boot/grub/menu.lst, /boot/grub/grub.cfg, or /boot/grub2/grub.cfg but I cannot find it there. What is wrong with your Linux distribution?"); 707 707 } 708 mr_asprintf( &bootldr_ver, "%s", call_program_and_get_last_line_of_output("grub --version"));708 mr_asprintf(bootldr_ver, "%s", call_program_and_get_last_line_of_output("grub --version")); 709 709 } else if (bkpinfo->boot_loader == 'E') { 710 mr_asprintf( &bootldr_str, "ELILO");710 mr_asprintf(bootldr_str, "ELILO"); 711 711 /* BCO: fix it for Debian, Mandrake, ... */ 712 712 if (!does_file_exist("/etc/elilo.conf") … … 739 739 } 740 740 } else if (bkpinfo->boot_loader == 'R') { 741 mr_asprintf( &bootldr_str, "RAW");741 mr_asprintf(bootldr_str, "RAW"); 742 742 } 743 743 #ifdef __FreeBSD__ 744 744 else if (bkpinfo->boot_loader == 'D') { 745 mr_asprintf( &bootldr_str, "DD");745 mr_asprintf(bootldr_str, "DD"); 746 746 } 747 747 748 748 else if (bkpinfo->boot_loader == 'B') { 749 mr_asprintf( &bootldr_str, "BOOT0");749 mr_asprintf(bootldr_str, "BOOT0"); 750 750 } 751 751 #endif 752 752 else { 753 mr_asprintf( &bootldr_str, "unknown");754 } 755 mr_asprintf( &tmp, "Your boot loader is %s and it boots from %s", bootldr_str, bkpinfo->boot_device);753 mr_asprintf(bootldr_str, "unknown"); 754 } 755 mr_asprintf(tmp, "Your boot loader is %s and it boots from %s", bootldr_str, bkpinfo->boot_device); 756 756 log_to_screen(tmp); 757 757 mr_free(tmp); 758 758 if (bootldr_ver != NULL) { 759 mr_asprintf( &tmp, "Boot loader version string: %s", bootldr_ver);759 mr_asprintf(tmp, "Boot loader version string: %s", bootldr_ver); 760 760 log_to_screen(tmp); 761 761 mr_free(tmp); 762 762 } 763 763 764 mr_asprintf( &tmp, "%s/BOOTLOADER.DEVICE", bkpinfo->tmpdir);764 mr_asprintf(tmp, "%s/BOOTLOADER.DEVICE", bkpinfo->tmpdir); 765 765 if (write_one_liner_data_file(tmp, bkpinfo->boot_device)) { 766 766 log_msg(1, "%ld: Unable to write one-liner boot device", __LINE__); … … 770 770 switch (bkpinfo->backup_media_type) { 771 771 case cdr: 772 mr_asprintf( &value, "cdr");772 mr_asprintf(value, "cdr"); 773 773 break; 774 774 case cdrw: 775 mr_asprintf( &value, "cdrw");775 mr_asprintf(value, "cdrw"); 776 776 break; 777 777 case cdstream: 778 mr_asprintf( &value, "cdstream");778 mr_asprintf(value, "cdstream"); 779 779 break; 780 780 case tape: 781 mr_asprintf( &value, "tape");781 mr_asprintf(value, "tape"); 782 782 break; 783 783 case udev: 784 mr_asprintf( &value, "udev");784 mr_asprintf(value, "udev"); 785 785 break; 786 786 case iso: 787 mr_asprintf( &value, "iso");787 mr_asprintf(value, "iso"); 788 788 break; 789 789 case netfs: 790 mr_asprintf( &value, "netfs");790 mr_asprintf(value, "netfs"); 791 791 break; 792 792 case dvd: 793 mr_asprintf( &value, "dvd");793 mr_asprintf(value, "dvd"); 794 794 break; 795 795 case usb: 796 mr_asprintf( &value, "usb");796 mr_asprintf(value, "usb"); 797 797 break; 798 798 default: … … 800 800 } 801 801 if (bkpinfo->backup_media_type == usb) { 802 mr_asprintf( &tmp2, "--usb %s", bkpinfo->media_device);802 mr_asprintf(tmp2, "--usb %s", bkpinfo->media_device); 803 803 } else { 804 mr_asprintf( &tmp2," ");805 } 806 807 mr_asprintf( &tmp, "%s/BACKUP-MEDIA-TYPE", bkpinfo->tmpdir);804 mr_asprintf(tmp2," "); 805 } 806 807 mr_asprintf(tmp, "%s/BACKUP-MEDIA-TYPE", bkpinfo->tmpdir); 808 808 if (write_one_liner_data_file(tmp, value)) { 809 809 res++; … … 814 814 mr_free(tmp); 815 815 816 mr_asprintf( &tmp, "%s/BOOTLOADER.NAME", bkpinfo->tmpdir);816 mr_asprintf(tmp, "%s/BOOTLOADER.NAME", bkpinfo->tmpdir); 817 817 if (write_one_liner_data_file(tmp, bootldr_str)) { 818 818 res++; … … 823 823 mr_free(tmp); 824 824 825 mr_asprintf( &tmp, "%s/BOOTLOADER.VER", bkpinfo->tmpdir);825 mr_asprintf(tmp, "%s/BOOTLOADER.VER", bkpinfo->tmpdir); 826 826 if (write_one_liner_data_file(tmp, bootldr_ver)) { 827 827 res++; … … 832 832 mr_free(tmp); 833 833 834 mr_asprintf( &tmp, "%s/DIFFERENTIAL", bkpinfo->tmpdir);834 mr_asprintf(tmp, "%s/DIFFERENTIAL", bkpinfo->tmpdir); 835 835 if (bkpinfo->differential) { 836 836 res += write_one_liner_data_file(tmp, "1"); … … 841 841 842 842 if (g_getfattr) { 843 mr_asprintf( &tmp1, "%s/XATTR", bkpinfo->tmpdir);843 mr_asprintf(tmp1, "%s/XATTR", bkpinfo->tmpdir); 844 844 if (write_one_liner_data_file(tmp1, "TRUE")) { 845 845 log_msg(1, "%ld: Unable to write one-liner XATTR", … … 849 849 } 850 850 if (g_getfacl) { 851 mr_asprintf( &tmp1, "%s/ACL", bkpinfo->tmpdir);851 mr_asprintf(tmp1, "%s/ACL", bkpinfo->tmpdir); 852 852 if (write_one_liner_data_file(tmp1, "TRUE")) { 853 853 log_msg(1, "%ld: Unable to write one-liner ACL", … … 857 857 } 858 858 if (bkpinfo->use_obdr) { 859 mr_asprintf( &tmp1, "%s/OBDR", bkpinfo->tmpdir);859 mr_asprintf(tmp1, "%s/OBDR", bkpinfo->tmpdir); 860 860 if (write_one_liner_data_file(tmp1, "TRUE")) { 861 861 log_msg(1, "%ld: Unable to write one-liner OBDR", … … 868 868 size_of_all_biggiefiles_K(bkpinfo) / bkpinfo->optimal_set_size + 1; 869 869 /* add netfs stuff here? */ 870 mr_asprintf( &command, "mkdir -p %s/images", bkpinfo->scratchdir);870 mr_asprintf(command, "mkdir -p %s/images", bkpinfo->scratchdir); 871 871 if (system(command)) { 872 872 res++; … … 880 880 6=\"%s\" 7=%ld 8=\"%s\" 9=\"%s\" 10=\"%s\" \ 881 881 11=\"%s\" 12=%s 13=%ld 14=\"%s\" 15=\"%s\" 16=\"%s\" 17=\"%s\" 18=%ld 19=%d",*/ 882 mr_asprintf( &command, "mindi %s --custom %s %s/images '%s' '%s' \882 mr_asprintf(command, "mindi %s --custom %s %s/images '%s' '%s' \ 883 883 '%s' %ld '%s' '%s' '%s' \ 884 884 '%s' %s %ld '%s' '%s' '%s' '%s' %ld %d '%s'", tmp2, bkpinfo->tmpdir, // parameter #2 … … 929 929 if (!res) { 930 930 log_to_screen("Boot+data disks were created OK"); 931 mr_asprintf( &command, "cp -f %s/images/mindi.iso %s/mondorescue.iso",931 mr_asprintf(command, "cp -f %s/images/mindi.iso %s/mondorescue.iso", 932 932 bkpinfo->scratchdir, MINDI_CACHE); 933 933 log_msg(2, command); … … 936 936 937 937 if (bkpinfo->nonbootable_backup) { 938 mr_asprintf( &command, "cp -f %s/all.tar.gz %s/images",938 mr_asprintf(command, "cp -f %s/all.tar.gz %s/images", 939 939 bkpinfo->tmpdir, bkpinfo->scratchdir); 940 940 if (system(command)) { … … 946 946 /* For USB we already have everything on the key */ 947 947 if (bkpinfo->backup_media_type == usb) { 948 mr_asprintf( &command, "rm -rf %s/images", bkpinfo->scratchdir);948 mr_asprintf(command, "rm -rf %s/images", bkpinfo->scratchdir); 949 949 run_program_and_log_output(command, FALSE); 950 950 paranoid_free(command); 951 951 } else { 952 mr_asprintf( &tmp, "cp -f %s/images/all.tar.gz %s", bkpinfo->scratchdir,952 mr_asprintf(tmp, "cp -f %s/images/all.tar.gz %s", bkpinfo->scratchdir, 953 953 bkpinfo->tmpdir); 954 954 if (system(tmp)) { … … 964 964 } else { 965 965 log_to_screen("Mindi failed to create your boot+data disks."); 966 mr_asprintf( &command, "grep 'Fatal error' /var/log/mindi.log");967 mr_asprintf( &tmp, "%s", call_program_and_get_last_line_of_output(command));966 mr_asprintf(command, "grep 'Fatal error' /var/log/mindi.log"); 967 mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output(command)); 968 968 paranoid_free(command); 969 969 … … 1470 1470 sleep(5); 1471 1471 } 1472 mr_asprintf( &media_usage_comment, "%s", percent_media_full_comment());1472 mr_asprintf(media_usage_comment, "%s", percent_media_full_comment()); 1473 1473 /* copy to CD (scratchdir) ... and an actual CD-R if necessary */ 1474 1474 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) { … … 1513 1513 mr_free(media_usage_comment); 1514 1514 if (res) { 1515 mr_asprintf( &tmp, "Failed to add archive %ld's files to CD dir\n",1515 mr_asprintf(tmp, "Failed to add archive %ld's files to CD dir\n", 1516 1516 storing_set_no); 1517 1517 log_to_screen(tmp); … … 1526 1526 close_progress_form(); 1527 1527 1528 mr_asprintf( &tmp, "Your regular files have been archived ");1528 mr_asprintf(tmp, "Your regular files have been archived "); 1529 1529 log_msg(2, "Joining background threads to foreground thread"); 1530 1530 for (i = 0; i < noof_threads; i++) { … … 1596 1596 log_msg(2, "make_usb_fs --- scratchdir=%s", bkpinfo->scratchdir); 1597 1597 tmp1 = getcwd(old_pwd, MAX_STR_LEN - 1); 1598 mr_asprintf( &tmp, "chmod 700 %s", bkpinfo->scratchdir);1598 mr_asprintf(tmp, "chmod 700 %s", bkpinfo->scratchdir); 1599 1599 run_program_and_log_output(tmp, FALSE); 1600 1600 paranoid_free(tmp); … … 1604 1604 1605 1605 mds = media_descriptor_string(bkpinfo->backup_media_type); 1606 mr_asprintf( &message_to_screen, "Copying data to make %s #%d",mds, g_current_media_number);1606 mr_asprintf(message_to_screen, "Copying data to make %s #%d",mds, g_current_media_number); 1607 1607 mr_free(mds); 1608 1608 log_msg(1, message_to_screen); 1609 1609 1610 mr_asprintf( &tmp1, "%s1", bkpinfo->media_device);1610 mr_asprintf(tmp1, "%s1", bkpinfo->media_device); 1611 1611 if (is_this_device_mounted(tmp1)) { 1612 1612 log_msg(1, "USB device mounted. Remounting it at the right place"); 1613 mr_asprintf( &tmp, "umount %s", tmp1);1613 mr_asprintf(tmp, "umount %s", tmp1); 1614 1614 run_program_and_log_output(tmp, FALSE); 1615 1615 paranoid_free(tmp); … … 1618 1618 1619 1619 log_msg(1, "Mounting USB device."); 1620 mr_asprintf( &tmp1, "%s/usb", bkpinfo->tmpdir);1621 mr_asprintf( &tmp, "mkdir -p %s", tmp1);1620 mr_asprintf(tmp1, "%s/usb", bkpinfo->tmpdir); 1621 mr_asprintf(tmp, "mkdir -p %s", tmp1); 1622 1622 run_program_and_log_output(tmp, FALSE); 1623 1623 paranoid_free(tmp); 1624 1624 1625 1625 /* Mindi always create one single parition on the USB dev */ 1626 mr_asprintf( &tmp, "mount %s1 %s", bkpinfo->media_device, tmp1);1626 mr_asprintf(tmp, "mount %s1 %s", bkpinfo->media_device, tmp1); 1627 1627 run_program_and_log_output(tmp, FALSE); 1628 1628 paranoid_free(tmp); … … 1634 1634 1635 1635 /* Command to execute */ 1636 mr_asprintf( &tmp,"mv %s/* %s", bkpinfo->scratchdir, tmp1);1636 mr_asprintf(tmp,"mv %s/* %s", bkpinfo->scratchdir, tmp1); 1637 1637 res = eval_call_to_make_USB(tmp, message_to_screen); 1638 1638 if (res) { 1639 mr_asprintf( &result_sz, "%s ...failed",tmp);1639 mr_asprintf(result_sz, "%s ...failed",tmp); 1640 1640 } else { 1641 mr_asprintf( &result_sz, "%s ...OK",tmp);1641 mr_asprintf(result_sz, "%s ...OK",tmp); 1642 1642 } 1643 1643 log_to_screen(result_sz); … … 1647 1647 1648 1648 /* Recreate the required structure under the scratch dir */ 1649 mr_asprintf( &tmp,"mkdir %s/archive", bkpinfo->scratchdir);1649 mr_asprintf(tmp,"mkdir %s/archive", bkpinfo->scratchdir); 1650 1650 run_program_and_log_output(tmp, FALSE); 1651 1651 paranoid_free(tmp); … … 1655 1655 1656 1656 if (is_this_device_mounted(bkpinfo->media_device)) { 1657 mr_asprintf( &tmp, "umount %s1", bkpinfo->media_device);1657 mr_asprintf(tmp, "umount %s1", bkpinfo->media_device); 1658 1658 run_program_and_log_output(tmp, FALSE); 1659 1659 paranoid_free(tmp); … … 1744 1744 1745 1745 if (bkpinfo->call_before_iso[0] != '\0') { 1746 mr_asprintf( &message_to_screen, "Running pre-ISO call for CD#%d",1746 mr_asprintf(message_to_screen, "Running pre-ISO call for CD#%d", 1747 1747 g_current_media_number); 1748 1748 res = … … 1765 1765 sprintf(tmp, "%s/archives/NOT-THE-LAST", bkpinfo->scratchdir); 1766 1766 mds = media_descriptor_string(bkpinfo->backup_media_type); 1767 mr_asprintf( &message_to_screen, "Making an ISO (%s #%d)", mds, g_current_media_number);1767 mr_asprintf(message_to_screen, "Making an ISO (%s #%d)", mds, g_current_media_number); 1768 1768 mr_free(mds); 1769 1769 … … 1810 1810 } 1811 1811 pause_for_N_seconds(5, "Letting DVD drive settle"); 1812 mr_asprintf( &sz_blank_disk, "dvd+rw-format -force %s", bkpinfo->media_device);1812 mr_asprintf(sz_blank_disk, "dvd+rw-format -force %s", bkpinfo->media_device); 1813 1813 log_msg(3, "sz_blank_disk = '%s'", sz_blank_disk); 1814 1814 res = … … 1864 1864 } else { 1865 1865 mds = media_descriptor_string(bkpinfo->backup_media_type); 1866 mr_asprintf( &message_to_screen, "Running mkisofs to make %s #%d", mds, g_current_media_number);1866 mr_asprintf(message_to_screen, "Running mkisofs to make %s #%d", mds, g_current_media_number); 1867 1867 log_msg(1, message_to_screen); 1868 mr_asprintf( &result_sz, "Call to mkisofs to make ISO (%s #%d) ", mds, g_current_media_number);1868 mr_asprintf(result_sz, "Call to mkisofs to make ISO (%s #%d) ", mds, g_current_media_number); 1869 1869 mr_free(mds); 1870 1870 if (find_home_of_exe("genisoimage")) { 1871 mr_asprintf( &isofs_cmd, "%s", MONDO_GENISOIMAGE_CMD);1871 mr_asprintf(isofs_cmd, "%s", MONDO_GENISOIMAGE_CMD); 1872 1872 } else { 1873 mr_asprintf( &isofs_cmd, "%s", MONDO_MKISOFS_CMD);1873 mr_asprintf(isofs_cmd, "%s", MONDO_MKISOFS_CMD); 1874 1874 } 1875 1875 if (bkpinfo->nonbootable_backup) { 1876 1876 log_msg(1, "Making nonbootable backup"); 1877 mr_asprintf( &full_isofs_cmd, "%s%s-o '_ISO_' -V _CD#_ .",isofs_cmd,MONDO_MKISOFS);1877 mr_asprintf(full_isofs_cmd, "%s%s-o '_ISO_' -V _CD#_ .",isofs_cmd,MONDO_MKISOFS); 1878 1878 res = eval_call_to_make_ISO(full_isofs_cmd, 1879 1879 destfile, g_current_media_number, … … 1894 1894 #ifdef __IA64__ 1895 1895 log_msg(1, "IA64 --> elilo"); 1896 mr_asprintf( &full_isofs_cmd, "%s%s-o '_ISO_' -V _CD#_ .",isofs_cmd,MONDO_MKISOFS_REGULAR_ELILO);1896 mr_asprintf(full_isofs_cmd, "%s%s-o '_ISO_' -V _CD#_ .",isofs_cmd,MONDO_MKISOFS_REGULAR_ELILO); 1897 1897 res = eval_call_to_make_ISO(full_isofs_cmd, 1898 1898 destfile, … … 1903 1903 #else 1904 1904 log_msg(1, "Non-ia64 --> lilo"); 1905 mr_asprintf( &full_isofs_cmd, "%s%s-b images/mindi-bootroot.2880.img -c boot.cat -o '_ISO_' -J -V _CD#_ .",isofs_cmd,MONDO_MKISOFS);1905 mr_asprintf(full_isofs_cmd, "%s%s-b images/mindi-bootroot.2880.img -c boot.cat -o '_ISO_' -J -V _CD#_ .",isofs_cmd,MONDO_MKISOFS); 1906 1906 res = 1907 1907 // FIXME: fixed boot size probably wrong. lilo to be removed … … 1915 1915 log_msg(1, "make_cd_use_lilo = FALSE"); 1916 1916 log_msg(1, "Isolinux"); 1917 mr_asprintf( &full_isofs_cmd, "%s%s-o '_ISO_' -V _CD#_ .",isofs_cmd,MONDO_MKISOFS_REGULAR_SYSLINUX);1917 mr_asprintf(full_isofs_cmd, "%s%s-o '_ISO_' -V _CD#_ .",isofs_cmd,MONDO_MKISOFS_REGULAR_SYSLINUX); 1918 1918 res = 1919 1919 eval_call_to_make_ISO(full_isofs_cmd, … … 1951 1951 log_msg(2, "bkpinfo->call_burn_iso = %s", bkpinfo->call_burn_iso); 1952 1952 mds = media_descriptor_string(bkpinfo->backup_media_type); 1953 mr_asprintf( &message_to_screen, "Burning %s #%d", mds, g_current_media_number);1953 mr_asprintf(message_to_screen, "Burning %s #%d", mds, g_current_media_number); 1954 1954 mr_free(mds); 1955 1955 pause_and_ask_for_cdr(2, &cd_is_mountable); … … 1971 1971 if (bkpinfo->call_after_iso[0] != '\0') { 1972 1972 mds = media_descriptor_string(bkpinfo->backup_media_type); 1973 mr_asprintf( &message_to_screen, "Running post-ISO call (%s #%d)", mds, g_current_media_number);1973 mr_asprintf(message_to_screen, "Running post-ISO call (%s #%d)", mds, g_current_media_number); 1974 1974 mr_free(mds); 1975 1975 res = … … 2007 2007 bool ret = TRUE; 2008 2008 2009 mr_asprintf( &command, "dd if=%s bs=512 count=1 2> /dev/null | strings | head -n1", bigfile_fname);2009 mr_asprintf(command, "dd if=%s bs=512 count=1 2> /dev/null | strings | head -n1", bigfile_fname); 2010 2010 log_msg(1, "command = '%s'", command); 2011 mr_asprintf( &tmp, "%s", call_program_and_get_last_line_of_output(command));2011 mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output(command)); 2012 2012 mr_free(command); 2013 2013 … … 2083 2083 return (0); 2084 2084 } 2085 mr_asprintf( &tmp, "I am now backing up all large files.");2085 mr_asprintf(tmp, "I am now backing up all large files."); 2086 2086 log_to_screen(tmp); 2087 2087 noof_biggie_files = count_lines_in_file(biggielist_fname); … … 2127 2127 "Calling ntfsclone in background because %s is an NTFS partition", 2128 2128 bigfile_fname); 2129 mr_asprintf( &sz_devfile, "%s/%d.%d.000", bkpinfo->tmpdir,2129 mr_asprintf(sz_devfile, "%s/%d.%d.000", bkpinfo->tmpdir, 2130 2130 (int) (random() % 32768), 2131 2131 (int) (random() % 32768)); … … 2186 2186 p = bigfile_fname; 2187 2187 } 2188 mr_asprintf( &tmp, "Archiving %s ... ", bigfile_fname);2188 mr_asprintf(tmp, "Archiving %s ... ", bigfile_fname); 2189 2189 if (res) { 2190 2190 mr_strcat(tmp, "Failed!"); … … 2247 2247 for (;;) { 2248 2248 /* backup this set of files */ 2249 mr_asprintf( &curr_filelist_fname, FILELIST_FNAME_RAW_SZ, bkpinfo->tmpdir, curr_set_no);2249 mr_asprintf(curr_filelist_fname, FILELIST_FNAME_RAW_SZ, bkpinfo->tmpdir, curr_set_no); 2250 2250 if (! does_file_exist(curr_filelist_fname)) { 2251 2251 mr_free(curr_filelist_fname); … … 2253 2253 } 2254 2254 2255 mr_asprintf( &curr_afioball_fname, AFIOBALL_FNAME_RAW_SZ, bkpinfo->tmpdir, curr_set_no, bkpinfo->zip_suffix);2255 mr_asprintf(curr_afioball_fname, AFIOBALL_FNAME_RAW_SZ, bkpinfo->tmpdir, curr_set_no, bkpinfo->zip_suffix); 2256 2256 2257 2257 log_msg(1, "EXAT'g set %ld", curr_set_no); 2258 2258 if (g_getfattr) { 2259 mr_asprintf( &curr_xattr_list_fname, XATTR_LIST_FNAME_RAW_SZ, bkpinfo->tmpdir, curr_set_no);2259 mr_asprintf(curr_xattr_list_fname, XATTR_LIST_FNAME_RAW_SZ, bkpinfo->tmpdir, curr_set_no); 2260 2260 get_fattr_list(curr_filelist_fname, curr_xattr_list_fname); 2261 2261 } 2262 2262 if (g_getfacl) { 2263 mr_asprintf( &curr_acl_list_fname, ACL_LIST_FNAME_RAW_SZ, bkpinfo->tmpdir, curr_set_no);2263 mr_asprintf(curr_acl_list_fname, ACL_LIST_FNAME_RAW_SZ, bkpinfo->tmpdir, curr_set_no); 2264 2264 get_acl_list(curr_filelist_fname, curr_acl_list_fname); 2265 2265 } … … 2271 2271 retval += res; 2272 2272 if (res) { 2273 mr_asprintf( &tmp, "Errors occurred while archiving set %ld. Perhaps your live filesystem changed?", curr_set_no);2273 mr_asprintf(tmp, "Errors occurred while archiving set %ld. Perhaps your live filesystem changed?", curr_set_no); 2274 2274 log_to_screen(tmp); 2275 2275 mr_free(tmp); 2276 2276 } 2277 2277 2278 mr_asprintf( &media_usage_comment, "%s", percent_media_full_comment());2278 mr_asprintf(media_usage_comment, "%s", percent_media_full_comment()); 2279 2279 2280 2280 /* copy to CD (scratchdir) ... and an actual CD-R if necessary */ … … 2323 2323 2324 2324 if (res) { 2325 mr_asprintf( &tmp, "Failed to add archive %ld's files to CD dir\n", curr_set_no);2325 mr_asprintf(tmp, "Failed to add archive %ld's files to CD dir\n", curr_set_no); 2326 2326 log_to_screen(tmp); 2327 2327 mr_free(tmp); … … 2334 2334 } 2335 2335 close_progress_form(); 2336 mr_asprintf( &tmp, "Your regular files have been archived ");2336 mr_asprintf(tmp, "Your regular files have been archived "); 2337 2337 if (retval) { 2338 2338 mr_strcat(tmp, "(with errors)."); … … 2420 2420 mvaddstr_and_log_it(g_currentY, 0, 2421 2421 "Archiving large files to media "); 2422 mr_asprintf( &biggielist, "%s/archives/biggielist.txt", bkpinfo->scratchdir);2422 mr_asprintf(biggielist, "%s/archives/biggielist.txt", bkpinfo->scratchdir); 2423 2423 if (g_getfattr) { 2424 mr_asprintf( &xattr_fname, XATTR_BIGGLST_FNAME_RAW_SZ, bkpinfo->tmpdir);2424 mr_asprintf(xattr_fname, XATTR_BIGGLST_FNAME_RAW_SZ, bkpinfo->tmpdir); 2425 2425 } 2426 2426 if (g_getfacl) { 2427 mr_asprintf( &acl_fname, ACL_BIGGLST_FNAME_RAW_SZ, bkpinfo->tmpdir);2428 } 2429 2430 mr_asprintf( &command, "cp %s/biggielist.txt %s", bkpinfo->tmpdir,2427 mr_asprintf(acl_fname, ACL_BIGGLST_FNAME_RAW_SZ, bkpinfo->tmpdir); 2428 } 2429 2430 mr_asprintf(command, "cp %s/biggielist.txt %s", bkpinfo->tmpdir, 2431 2431 biggielist); 2432 2432 paranoid_system(command); 2433 2433 mr_free(command); 2434 2434 2435 mr_asprintf( &blah, "biggielist = %s", biggielist);2435 mr_asprintf(blah, "biggielist = %s", biggielist); 2436 2436 log_msg(2, blah); 2437 2437 mr_free(blah); … … 2443 2443 if (g_getfattr) { 2444 2444 get_fattr_list(biggielist, xattr_fname); 2445 mr_asprintf( &command, "cp %s %s/archives/", xattr_fname,2445 mr_asprintf(command, "cp %s %s/archives/", xattr_fname, 2446 2446 bkpinfo->scratchdir); 2447 2447 paranoid_system(command); … … 2450 2450 if (g_getfacl) { 2451 2451 get_acl_list(biggielist, acl_fname); 2452 mr_asprintf( &command, "cp %s %s/archives/", acl_fname, bkpinfo->scratchdir);2452 mr_asprintf(command, "cp %s %s/archives/", acl_fname, bkpinfo->scratchdir); 2453 2453 paranoid_system(command); 2454 2454 mr_free(command); … … 2457 2457 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) { 2458 2458 res += write_EXAT_files_to_tape(xattr_fname, acl_fname); 2459 mr_asprintf( &blah, "%ld", count_lines_in_file(biggielist));2459 mr_asprintf(blah, "%ld", count_lines_in_file(biggielist)); 2460 2460 write_header_block_to_stream((off_t)0, blah, BLK_START_BIGGIEFILES); 2461 2461 mr_free(blah); … … 2533 2533 continue; 2534 2534 } 2535 mr_asprintf( &curr_file, "%s", cf);2535 mr_asprintf(curr_file, "%s", cf); 2536 2536 if (!does_file_exist(curr_file)) { 2537 2537 log_msg(1, … … 2562 2562 continue; 2563 2563 } 2564 mr_asprintf( &curr_file, "%s", cf);2565 2566 mr_asprintf( &tmp, "mv -f %s %s/archives/", curr_file, bkpinfo->scratchdir);2564 mr_asprintf(curr_file, "%s", cf); 2565 2566 mr_asprintf(tmp, "mv -f %s %s/archives/", curr_file, bkpinfo->scratchdir); 2567 2567 mr_free(curr_file); 2568 2568 res = run_program_and_log_output(tmp, 5); … … 2636 2636 continue; 2637 2637 } 2638 mr_asprintf( &curr_file, "%s", cf);2638 mr_asprintf(curr_file, "%s", cf); 2639 2639 if (!does_file_exist(curr_file)) { 2640 2640 log_msg(1, … … 2687 2687 char *cdrecord = NULL; 2688 2688 2689 mr_asprintf( &bkp, "%s", cdrw_dev);2689 mr_asprintf(bkp, "%s", cdrw_dev); 2690 2690 if (find_cdrw_device(cdrw_dev)) { 2691 2691 strcpy(cdrw_dev, bkp); 2692 2692 } else { 2693 2693 if (!system("which cdrecord > /dev/null 2> /dev/null")) { 2694 mr_asprintf( &cdrecord, "cdrecord dev=%s -atip", cdrw_dev);2694 mr_asprintf(cdrecord, "cdrecord dev=%s -atip", cdrw_dev); 2695 2695 } else if (!system("which dvdrecord > /dev/null 2> /dev/null")) { 2696 mr_asprintf( &cdrecord, "cdrecord dev=%s -atip", cdrw_dev);2696 mr_asprintf(cdrecord, "cdrecord dev=%s -atip", cdrw_dev); 2697 2697 } else { 2698 2698 log_msg(2, "Oh well. I guess I'll just pray then."); … … 2753 2753 2754 2754 mds = media_descriptor_string(g_backup_media_type); 2755 mr_asprintf( &tmp, "I am about to burn %s #%d", mds, g_current_media_number);2755 mr_asprintf(tmp, "I am about to burn %s #%d", mds, g_current_media_number); 2756 2756 mr_free(mds); 2757 2757 log_to_screen(tmp); … … 2771 2771 retract_CD_tray_and_defeat_autorun(); 2772 2772 */ 2773 mr_asprintf( &tmp, "umount %s", cdrom_dev);2773 mr_asprintf(tmp, "umount %s", cdrom_dev); 2774 2774 run_program_and_log_output(tmp, 1); 2775 2775 sprintf(szcdno, "%s/archives/THIS-CD-NUMBER", mtpt); … … 2777 2777 sprintf(szunmount, "umount %s", mtpt); 2778 2778 cd_number = -1; 2779 mr_asprintf( &tmp, "mount %s %s", cdrom_dev, mtpt);2780 mr_asprintf( &our_serial_str, "%s", "");2779 mr_asprintf(tmp, "mount %s %s", cdrom_dev, mtpt); 2780 mr_asprintf(our_serial_str, "%s", ""); 2781 2781 attempt_to_mount_returned_this = run_program_and_log_output(tmp, 1); 2782 2782 mr_free(tmp); … … 2807 2807 2808 2808 cd_number = atoi(last_line_of_file(szcdno)); 2809 mr_asprintf( &tmp, "cat %s 2> /dev/null", szserfname);2809 mr_asprintf(tmp, "cat %s 2> /dev/null", szserfname); 2810 2810 mr_free(our_serial_str); 2811 mr_asprintf( &our_serial_str, "%s",2811 mr_asprintf(our_serial_str, "%s", 2812 2812 call_program_and_get_last_line_of_output(tmp)); 2813 2813 mr_free(tmp); … … 2849 2849 } 2850 2850 mds = media_descriptor_string(g_backup_media_type); 2851 mr_asprintf( &tmp, "I am about to burn %s #%d of the backup set. Please insert %s and press Enter.",2851 mr_asprintf(tmp, "I am about to burn %s #%d of the backup set. Please insert %s and press Enter.", 2852 2852 mds, g_current_media_number, mds); 2853 2853 mr_free(mds); … … 2994 2994 if (is_this_file_compressed(biggie_filename) 2995 2995 || bkpinfo->compression_level == 0) { 2996 mr_asprintf( &suffix, "%s", "");2996 mr_asprintf(suffix, "%s", ""); 2997 2997 // log_it("%s is indeed compressed :-)", filename); 2998 2998 should_I_compress_slices = FALSE; 2999 2999 } else { 3000 mr_asprintf( &suffix, "%s", bkpinfo->zip_suffix);3000 mr_asprintf(suffix, "%s", bkpinfo->zip_suffix); 3001 3001 should_I_compress_slices = TRUE; 3002 3002 } … … 3014 3014 fatal_error("ntfsresize not found"); 3015 3015 } 3016 mr_asprintf( &command, "ntfsresize --force --info %s|grep '^You might resize at '|cut -d' ' -f5", biggie_filename);3016 mr_asprintf(command, "ntfsresize --force --info %s|grep '^You might resize at '|cut -d' ' -f5", biggie_filename); 3017 3017 log_it("command = %s", command); 3018 mr_asprintf( &tmp, "%s", call_program_and_get_last_line_of_output(command));3018 mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output(command)); 3019 3019 mr_free(command); 3020 3020 log_it("res of it = %s", tmp); … … 3024 3024 file_to_openin = biggie_filename; 3025 3025 if (strchr(biggie_filename,'\'') != NULL) { 3026 mr_asprintf( &command, "md5sum \"%s\"", biggie_filename);3026 mr_asprintf(command, "md5sum \"%s\"", biggie_filename); 3027 3027 } else { 3028 mr_asprintf( &command, "md5sum '%s'", biggie_filename);3028 mr_asprintf(command, "md5sum '%s'", biggie_filename); 3029 3029 } 3030 3030 if (!(fin = popen(command, "r"))) { … … 3049 3049 strcpy(biggiestruct.checksum, checksum_line); 3050 3050 3051 mr_asprintf( &tmp, "%s", slice_fname(biggie_file_number, 0, bkpinfo->tmpdir, ""));3051 mr_asprintf(tmp, "%s", slice_fname(biggie_file_number, 0, bkpinfo->tmpdir, "")); 3052 3052 fout = fopen(tmp, "w"); 3053 3053 if (fout == NULL) { … … 3067 3067 if (!(fin = fopen(file_to_openin, "r"))) { 3068 3068 log_OS_error("Unable to openin biggie_filename"); 3069 mr_asprintf( &tmp, "Cannot archive bigfile '%s': not found", biggie_filename);3069 mr_asprintf(tmp, "Cannot archive bigfile '%s': not found", biggie_filename); 3070 3070 log_to_screen(tmp); 3071 3071 paranoid_free(tmp); … … 3089 3089 } 3090 3090 for (slice_num = 1; !finished; slice_num++) { 3091 mr_asprintf( &curr_slice_fname_uncompressed, "%s", slice_fname(biggie_file_number, slice_num, bkpinfo->tmpdir, ""));3092 mr_asprintf( &curr_slice_fname_compressed, "%s", slice_fname(biggie_file_number, slice_num, bkpinfo->tmpdir, suffix));3093 3094 mr_asprintf( &tmp, "%s", percent_media_full_comment());3091 mr_asprintf(curr_slice_fname_uncompressed, "%s", slice_fname(biggie_file_number, slice_num, bkpinfo->tmpdir, "")); 3092 mr_asprintf(curr_slice_fname_compressed, "%s", slice_fname(biggie_file_number, slice_num, bkpinfo->tmpdir, suffix)); 3093 3094 mr_asprintf(tmp, "%s", percent_media_full_comment()); 3095 3095 update_progress_form(tmp); 3096 3096 paranoid_free(tmp); … … 3124 3124 } 3125 3125 if (should_I_compress_slices && bkpinfo->compression_level > 0) { 3126 mr_asprintf( &command, "%s -%d %s", bkpinfo->zip_exe, bkpinfo->compression_level, curr_slice_fname_uncompressed);3126 mr_asprintf(command, "%s -%d %s", bkpinfo->zip_exe, bkpinfo->compression_level, curr_slice_fname_uncompressed); 3127 3127 log_msg(2, command); 3128 3128 if ((res = system(command))) { … … 3131 3131 // did_I_compress_slice = TRUE; 3132 3132 } else { 3133 mr_asprintf( &command, "mv %s %s 2>> %s", curr_slice_fname_uncompressed, curr_slice_fname_compressed, MONDO_LOGFILE);3133 mr_asprintf(command, "mv %s %s 2>> %s", curr_slice_fname_uncompressed, curr_slice_fname_compressed, MONDO_LOGFILE); 3134 3134 res = 0; // don't do it :) 3135 3135 // did_I_compress_slice = FALSE; … … 3147 3147 } 3148 3148 if (res) { 3149 mr_asprintf( &tmp, "Problem with slice # %ld", slice_num);3149 mr_asprintf(tmp, "Problem with slice # %ld", slice_num); 3150 3150 } else { 3151 mr_asprintf( &tmp, "%s - Bigfile #%ld, slice #%ld compressed OK ", biggie_filename, biggie_file_number + 1,3151 mr_asprintf(tmp, "%s - Bigfile #%ld, slice #%ld compressed OK ", biggie_filename, biggie_file_number + 1, 3152 3152 slice_num); 3153 3153 } … … 3164 3164 paranoid_free(tmp); 3165 3165 3166 mr_asprintf( &file_to_archive, "%s", curr_slice_fname_compressed);3166 mr_asprintf(file_to_archive, "%s", curr_slice_fname_compressed); 3167 3167 g_current_progress++; 3168 3168 } else { /* if i==0 then ... */ 3169 3169 3170 3170 finished = TRUE; 3171 mr_asprintf( &file_to_archive, "%s", curr_slice_fname_uncompressed);3171 mr_asprintf(file_to_archive, "%s", curr_slice_fname_uncompressed); 3172 3172 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) { 3173 3173 break; … … 3190 3190 retval += res; 3191 3191 if (res) { 3192 mr_asprintf( &tmp, "Failed to add slice %ld of bigfile %ld to scratchdir", slice_num, biggie_file_number + 1);3192 mr_asprintf(tmp, "Failed to add slice %ld of bigfile %ld to scratchdir", slice_num, biggie_file_number + 1); 3193 3193 log_to_screen(tmp); 3194 3194 paranoid_free(tmp); … … 3200 3200 mr_free(suffix); 3201 3201 paranoid_fclose(fin); 3202 mr_asprintf( &tmp, "Sliced bigfile #%ld", biggie_file_number + 1);3202 mr_asprintf(tmp, "Sliced bigfile #%ld", biggie_file_number + 1); 3203 3203 if (retval) { 3204 3204 mr_strcat(tmp, "...FAILED"); … … 3234 3234 assert_string_is_neither_NULL_nor_zerolength(d); 3235 3235 3236 mr_asprintf( &dir, "%s/archives", d);3237 mr_asprintf( &tmp, "find %s -name '*.afio*' -exec rm -f '{}' \\;", dir);3236 mr_asprintf(dir, "%s/archives", d); 3237 mr_asprintf(tmp, "find %s -name '*.afio*' -exec rm -f '{}' \\;", dir); 3238 3238 run_program_and_log_output(tmp, FALSE); 3239 3239 mr_free(tmp); 3240 mr_asprintf( &tmp, "find %s -name '*list.[0-9]*' -exec rm -f '{}' \\;", dir);3240 mr_asprintf(tmp, "find %s -name '*list.[0-9]*' -exec rm -f '{}' \\;", dir); 3241 3241 run_program_and_log_output(tmp, FALSE); 3242 3242 mr_free(tmp); 3243 mr_asprintf( &tmp, "find %s -name 'slice*' -exec rm -f '{}' \\;", dir);3243 mr_asprintf(tmp, "find %s -name 'slice*' -exec rm -f '{}' \\;", dir); 3244 3244 run_program_and_log_output(tmp, FALSE); 3245 3245 mr_free(tmp); 3246 mr_asprintf( &tmp, "rm -f %s/cklist*", dir);3246 mr_asprintf(tmp, "rm -f %s/cklist*", dir); 3247 3247 run_program_and_log_output(tmp, FALSE); 3248 3248 mr_free(tmp); 3249 mr_asprintf( &tmp, "rm -f %s/zero", dir);3249 mr_asprintf(tmp, "rm -f %s/zero", dir); 3250 3250 run_program_and_log_output(tmp, FALSE); 3251 3251 mr_free(tmp); 3252 3252 log_msg(1, "Wiped %s's archives", dir); 3253 mr_asprintf( &tmp, "ls -l %s", dir);3253 mr_asprintf(tmp, "ls -l %s", dir); 3254 3254 mr_free(dir); 3255 3255 run_program_and_log_output(tmp, FALSE); … … 3507 3507 log_msg(2, 3508 3508 "Not verifying again. Per-CD/ISO verification already carried out."); 3509 mr_asprintf( &tmp, "cat %s/changed.files > %s/changed.files 2> /dev/null",bkpinfo->tmpdir, MONDO_CACHE);3509 mr_asprintf(tmp, "cat %s/changed.files > %s/changed.files 2> /dev/null",bkpinfo->tmpdir, MONDO_CACHE); 3510 3510 paranoid_system(tmp); 3511 3511 mr_free(tmp); … … 3532 3532 if (res) { 3533 3533 mds = media_descriptor_string(bkpinfo->backup_media_type); 3534 mr_asprintf( &tmp, "Warnings/errors were reported while checking %s #%d", mds, g_current_media_number);3534 mr_asprintf(tmp, "Warnings/errors were reported while checking %s #%d", mds, g_current_media_number); 3535 3535 mr_free(mds); 3536 3536 log_to_screen(tmp); … … 3539 3539 } 3540 3540 } 3541 mr_asprintf( &tmp, "grep 'afio: ' %s | sed 's/afio: //' | grep -vE '^/dev/.*$' >> %s/changed.files", MONDO_LOGFILE, MONDO_CACHE);3541 mr_asprintf(tmp, "grep 'afio: ' %s | sed 's/afio: //' | grep -vE '^/dev/.*$' >> %s/changed.files", MONDO_LOGFILE, MONDO_CACHE); 3542 3542 res = system(tmp); 3543 3543 mr_free(tmp); 3544 3544 3545 mr_asprintf( &tmp, "grep 'star: ' %s | sed 's/star: //' | grep -vE '^/dev/.*$' >> %s/changed.files", MONDO_LOGFILE, MONDO_CACHE);3545 mr_asprintf(tmp, "grep 'star: ' %s | sed 's/star: //' | grep -vE '^/dev/.*$' >> %s/changed.files", MONDO_LOGFILE, MONDO_CACHE); 3546 3546 res = system(tmp); 3547 3547 mr_free(tmp); … … 3552 3552 } 3553 3553 } 3554 mr_asprintf( &tmp, "%s/changed.files", MONDO_CACHE);3554 mr_asprintf(tmp, "%s/changed.files", MONDO_CACHE); 3555 3555 diffs = count_lines_in_file(tmp); 3556 3556 mr_free(tmp);
Note:
See TracChangeset
for help on using the changeset viewer.