Changeset 1663 in MondoRescue for branches/stable/mondo/src/mondoarchive/mondoarchive.c
- Timestamp:
- Sep 27, 2007, 12:21:18 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mondo/src/mondoarchive/mondoarchive.c
r1639 r1663 62 62 /****************** subroutines used only here ******************/ 63 63 64 /* Reference to global bkpinfo */ 65 struct s_bkpinfo *bkpinfo; 66 67 /****************** subroutines used only by main.c ******************/ 64 68 65 69 /** … … 386 390 int main(int argc, char *argv[]) 387 391 { 388 struct s_bkpinfo *bkpinfo = NULL;389 392 struct stat stbuf; 390 393 char *tmp = NULL; … … 399 402 #endif 400 403 printf(_("Initializing...\n")); 404 405 bkpinfo = mr_malloc(sizeof(struct s_bkpinfo)); 406 reset_bkpinfo(); 401 407 402 408 /* Reference a dummy cleanup function for mr_exit temporarily */ … … 463 469 malloc_libmondo_global_strings(); 464 470 diffs = 0; 465 bkpinfo = mr_malloc(sizeof(struct s_bkpinfo));466 471 if (stat(MONDO_CACHE, &stbuf) != 0) { 467 472 mr_mkdir(MONDO_CACHE,0x755); … … 580 585 } 581 586 582 if (pre_param_configuration( bkpinfo)) {587 if (pre_param_configuration()) { 583 588 fatal_error 584 589 ("Pre-param initialization phase failed. Please review the error messages above, make the specified changes, then try again. Exiting..."); … … 591 596 g_text_mode = FALSE; 592 597 setup_newt_stuff(); 593 res = interactively_obtain_media_parameters_from_user( bkpinfo,TRUE); /* yes, archiving */598 res = interactively_obtain_media_parameters_from_user(TRUE); /* yes, archiving */ 594 599 if (res) { 595 600 fatal_error … … 597 602 } 598 603 } else { 599 res = handle_incoming_parameters(argc, argv , bkpinfo);604 res = handle_incoming_parameters(argc, argv); 600 605 if (res) { 601 606 mr_msg(1, … … 609 614 610 615 /* Finish configuring global structures */ 611 if (post_param_configuration( bkpinfo)) {616 if (post_param_configuration()) { 612 617 fatal_error 613 618 ("Post-param initialization phase failed. Perhaps bad parameters were supplied to mondoarchive? Please review the documentation, error messages and logs. Exiting..."); … … 622 627 /* If we're meant to backup then backup */ 623 628 if (bkpinfo->backup_data) { 624 res = backup_data( bkpinfo);629 res = backup_data(); 625 630 retval += res; 626 631 if (res) { … … 634 639 /* If we're meant to verify then verify */ 635 640 if (bkpinfo->verify_data) { 636 res = verify_data( bkpinfo);641 res = verify_data(); 637 642 if (res < 0) { 638 643 mr_asprintf(&say_at_end2, _("%d difference%c found."), -res, … … 657 662 } 658 663 659 660 if (length_of_file("/tmp/changed.files") > 2) { 664 if (length_of_file(MINDI_CACHE"/changed.files") > 2) { 661 665 if (g_text_mode) { 662 666 log_to_screen 663 (_("Type 'less /tmp/changed.files' to see which files don't match the archives"));667 (_("Type 'less "MINDI_CACHE"/changed.files' to see which files don't match the archives")); 664 668 } else { 665 669 mr_msg(1, 666 _("Type 'less /tmp/changed.files' to see which files don't match the archives"));670 _("Type 'less "MINDI_CACHE"/changed.files' to see which files don't match the archives")); 667 671 mr_msg(2, "Calling popup_changelist_from_file()"); 668 popup_changelist_from_file( "/tmp/changed.files");672 popup_changelist_from_file(MINDI_CACHE"/changed.files"); 669 673 mr_msg(2, "Returned from popup_changelist_from_file()"); 670 674 } 671 675 } else { 672 unlink( "/tmp/changed.files");676 unlink(MINDI_CACHE"/changed.files"); 673 677 } 674 678 log_to_screen(say_at_end); … … 687 691 688 692 system("rm -f /var/cache/mondo-archive/last-backup.aborted"); 689 system("rm -Rf /tmp.mondo.* /mondo.scratch.*");690 693 if (!retval) { 691 694 printf(_("Mondoarchive ran OK.\n")); … … 698 701 chdir("/tmp"); // just in case there's something wrong with g_erase_tmpdir_and_scratchdir 699 702 system(g_erase_tmpdir_and_scratchdir); 703 704 /* assemble command string for deletion of Mondo's tmp directory */ 705 sprintf(tmp, "rm -Rf %s", bkpinfo->tmpdir); 706 700 707 free_libmondo_global_strings(); 701 708 mr_free(bkpinfo); 702 703 unlink("/tmp/filelist.full");704 unlink("/tmp/filelist.full.gz");705 709 706 710 if (!g_cdrom_drive_is_here) { … … 714 718 mr_msg(1, "Time finished: %s", mr_date()); 715 719 mr_msg_close(); 720 721 /* remove Mondo's tmp directory */ 722 system(tmp); 723 paranoid_free(tmp); 716 724 717 725 if (!g_text_mode) {
Note:
See TracChangeset
for help on using the changeset viewer.