- Timestamp:
- Sep 23, 2007, 2:41:29 AM (18 years ago)
- Location:
- branches/2.2.5/mondo/src
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.5/mondo/src/common/libmondo-archive.c
r1614 r1644 1474 1474 } 1475 1475 /* if not Debian then go ahead & use fdformat */ 1476 strcpy(tempfile, 1477 call_program_and_get_last_line_of_output 1478 ("mktemp -q /tmp/mondo.XXXXXXXX")); 1476 sprintf(tempfile, "%s/mondo.floppy.log", bkpinfo->tmpdir); 1479 1477 sprintf(command, "%s >> %s 2>> %s; rm -f %s", cmd, tempfile, tempfile, 1480 1478 tempfile); … … 3195 3193 } 3196 3194 log_to_screen("Scanning CD-ROM drive..."); 3197 sprintf(mtpt, "/tmp/cd.mtpt.%ld.%ld", (long int) random(), 3198 (long int) random()); 3195 sprintf(mtpt, "%s/cd.mtpt", bkpinfo->tmpdir); 3199 3196 make_hole_for_dir(mtpt); 3200 3197 … … 3959 3956 log_msg(2, 3960 3957 "Not verifying again. Per-CD/ISO verification already carried out."); 3961 paranoid_system3962 ("cat /tmp/changed.files.* > /tmp/changed.files 2> /dev/null");3958 sprintf(tmp, "cat %s/changed.files > %s/changed.files 2> /dev/null",bkpinfo->tmpdir, MINDI_CACHE); 3959 paranoid_system(tmp); 3963 3960 } else { 3964 3961 g_current_media_number = cdno; … … 3996 3993 */ 3997 3994 sprintf(tmp, 3998 "grep 'afio: ' %s | sed 's/afio: //' | grep -vE '^/dev/.*$' >> /tmp/changed.files",3999 MONDO_LOGFILE );3995 "grep 'afio: ' %s | sed 's/afio: //' | grep -vE '^/dev/.*$' >> %s/changed.files", 3996 MONDO_LOGFILE, MINDI_CACHE); 4000 3997 system(tmp); 4001 3998 4002 3999 sprintf(tmp, 4003 "grep 'star: ' %s | sed 's/star: //' | grep -vE '^/dev/.*$' >> /tmp/changed.files",4004 MONDO_LOGFILE );4000 "grep 'star: ' %s | sed 's/star: //' | grep -vE '^/dev/.*$' >> %s/changed.files", 4001 MONDO_LOGFILE, MINDI_CACHE); 4005 4002 system(tmp); 4006 4003 run_program_and_log_output("umount " MNT_CDROM, FALSE); … … 4010 4007 //} 4011 4008 } 4012 diffs = count_lines_in_file("/tmp/changed.files"); 4009 sprintf(tmp, "%s/changed.files", MINDI_CACHE); 4010 diffs = count_lines_in_file(tmp); 4013 4011 4014 4012 if (diffs > 0) { -
branches/2.2.5/mondo/src/common/libmondo-devices.c
r1575 r1644 855 855 } 856 856 857 sprintf(mountpoint, " /tmp/cd.%d", (int) (random() % 32767));857 sprintf(mountpoint, "%s/cd.mnt", bkpinfo->tmpdir); 858 858 make_hole_for_dir(mountpoint); 859 859 … … 1732 1732 run_program_and_log_output("umount " MNT_CDROM, 5); 1733 1733 } 1734 system("mkdir -p /tmp/isodir &> /dev/null"); 1734 sprintf(tmp, "mkdir -p %s/isodir &> /dev/null", bkpinfo->tmpdir); 1735 system(tmp); 1735 1736 sprintf(tmp, "%s/%s/%s-%d.iso", bkpinfo->isodir, 1736 1737 bkpinfo->nfs_remote_dir, bkpinfo->prefix, 1737 1738 cd_number_i_want); 1738 1739 if (!does_file_exist(tmp)) { 1739 sprintf(tmp, " /tmp/isodir/%s/%s-%d.iso",1740 sprintf(tmp, "%s/isodir/%s/%s-%d.iso", bkpinfo->tmpdir, 1740 1741 bkpinfo->nfs_remote_dir, bkpinfo->prefix, 1741 1742 cd_number_i_want); 1742 1743 if (does_file_exist(tmp)) { 1743 1744 log_msg(1, 1744 "FIXME - hacking bkpinfo->isodir from '%s' to /tmp/isodir",1745 bkpinfo->isodir );1746 s trcpy(bkpinfo->isodir, "/tmp/isodir");1745 "FIXME - hacking bkpinfo->isodir from '%s' to %s/isodir", 1746 bkpinfo->isodir, bkpinfo->tmpdir); 1747 sprintf(bkpinfo->isodir, "%s/isodir", bkpinfo->tmpdir); 1747 1748 } 1748 1749 } … … 2117 2118 } 2118 2119 if (bkpinfo->disaster_recovery) { 2119 system("umount /tmp/isodir 2> /dev/null"); 2120 sprintf(command ,"umount %s/isodir 2> /dev/null", bkpinfo->tmpdir); 2121 system(command); 2120 2122 if (!popup_and_get_string 2121 2123 ("NFS share", "Which remote NFS share should I mount?", … … 2126 2128 } 2127 2129 if (!is_this_device_mounted(bkpinfo->nfs_mount)) { 2128 sprintf(bkpinfo->isodir, "/tmp/isodir.mondo.%d", 2129 (int) (random() % 32768)); 2130 sprintf(bkpinfo->isodir, "%s/nfsdir", bkpinfo->tmpdir); 2130 2131 sprintf(command, "mkdir -p %s", bkpinfo->isodir); 2131 2132 run_program_and_log_output(command, 5); -
branches/2.2.5/mondo/src/common/libmondo-filelist.c
r1552 r1644 268 268 malloc_string(tmp_fname); 269 269 malloc_string(command); 270 sprintf(tmp_fname, "/tmp/sort.%d.%d.%d", (int) (random() % 32768), 271 (int) (random() % 32768), (int) (random() % 32768)); 270 sprintf(tmp_fname, "%s/sortfile", bkpinfo->tmpdir); 272 271 273 272 if (!does_file_exist(orig_fname)) { … … 683 682 malloc_string(syscall_pin); 684 683 malloc_string(syscall_pout); 685 sprintf(masklist, "/tmp/%d.%d.mask", (int) (random() % 32768), 686 (int) (random() % 32768)); 684 sprintf(masklist, "%s/masklist", bkpinfo->tmpdir); 687 685 sprintf(command, "cp -f %s %s", orig_msklist, masklist); 688 686 run_program_and_log_output(command, 1); -
branches/2.2.5/mondo/src/common/libmondo-fork.c
r1316 r1644 339 339 log_if_failure = TRUE; 340 340 } 341 sprintf(callstr, 342 "%s > /tmp/mondo-run-prog-thing.tmp 2> /tmp/mondo-run-prog-thing.err", 343 program); 341 sprintf(callstr, "%s > %s/mondo-run-prog-thing.tmp 2> %s/mondo-run-prog-thing.err", 342 program, bkpinfo->tmpdir, bkpinfo->tmpdir); 344 343 while ((p = strchr(callstr, '\r'))) { 345 344 *p = ' '; … … 368 367 "--------------------------------start of output-----------------------------"); 369 368 } 370 if (log_if_failure 371 && 372 system 373 ("cat /tmp/mondo-run-prog-thing.err >> /tmp/mondo-run-prog-thing.tmp 2> /dev/null")) 374 { 369 sprintf(callstr, "cat %s/mondo-run-prog-thing.err >> %s/mondo-run-prog-thing.tmp 2> /dev/null", bkpinfo->tmpdir, bkpinfo->tmpdir); 370 if (log_if_failure && system(callstr)) { 375 371 log_OS_error("Command failed"); 376 372 } 377 unlink("/tmp/mondo-run-prog-thing.err"); 378 fin = fopen("/tmp/mondo-run-prog-thing.tmp", "r"); 373 sprintf(tmp, "%s/mondo-run-prog-thing.err", bkpinfo->tmpdir); 374 unlink(tmp); 375 sprintf(tmp, "%s/mondo-run-prog-thing.tmp", bkpinfo->tmpdir); 376 fin = fopen(tmp, "r"); 379 377 if (fin) { 380 378 for (fgets(incoming, MAX_STR_LEN, fin); !feof(fin); … … 397 395 paranoid_fclose(fin); 398 396 } 399 unlink( "/tmp/mondo-run-prog-thing.tmp");397 unlink(tmp); 400 398 if ((res == 0 && log_if_success) || (res != 0 && log_if_failure)) { 401 399 log_msg(0, … … 441 439 assert_string_is_neither_NULL_nor_zerolength(basic_call); 442 440 443 sprintf(lockfile, " /tmp/mojo-jojo.blah.XXXXXX");444 mkstemp(lockfile); 441 sprintf(lockfile, "%s/mojo-jojo.bla.bla", bkpinfo->tmpdir); 442 445 443 sprintf(command, 446 444 "echo hi > %s ; %s >> %s 2>> %s; res=$?; sleep 1; rm -f %s; exit $res", … … 514 512 char *tmp; 515 513 char *buf; 514 char filestr[MAX_STR_LEN]; 516 515 long int bytes_to_be_read, bytes_read_in, bytes_written_out = 517 516 0, bufcap, subsliceno = 0; … … 614 613 log_msg(5, "tmpB is %s", tmp); 615 614 if (!strstr(tmp, PIMP_END_SZ)) { 616 ftmp = fopen("/tmp/out.leftover", "w"); 615 sprintf(filestr, "%s/out.leftover", bkpinfo->tmpdir); 616 ftmp = fopen(filestr, "w"); 617 617 bytes_read_in = fread(tmp, 1, 64, fin); 618 618 log_msg(1, "bytes_read_in = %ld", bytes_read_in); … … 693 693 694 694 strcpy(title, tt); 695 strcpy(tempfile, 696 call_program_and_get_last_line_of_output 697 ("mktemp -q /tmp/mondo.XXXXXXXX")); 695 sprintf(tempfile, "%s/mondo.binperc", bkpinfo->tmpdir); 698 696 sprintf(command, "%s >> %s 2>> %s; rm -f %s", cmd, tempfile, tempfile, 699 697 tempfile); -
branches/2.2.5/mondo/src/common/libmondo-tools.c
r1437 r1644 999 999 bkpinfo->scratchdir[0] = '\0'; 1000 1000 bkpinfo->make_filelist = TRUE; // unless -J supplied to mondoarchive 1001 sprintf(bkpinfo->tmpdir, " /tmp/tmpfs/mondo.tmp.%d", (int) (random() % 32768)); // for mondorestore1001 sprintf(bkpinfo->tmpdir, "%s/tmpfs/mondo.tmp.%d", "/tmp", (int) (random() % 32768)); // for mondorestore 1002 1002 bkpinfo->optimal_set_size = 0; 1003 1003 bkpinfo->backup_media_type = none; … … 1227 1227 fatal_error("Please reinstall Mondo and Mindi."); 1228 1228 } 1229 if (run_program_and_log_output1230 ("mindi --makemountlist /tmp/mountlist.txt.test", 5)) {1231 log_to_screen1232 ("Mindi --makemountlist /tmp/mountlist.txt.test failed for some reason.");1229 sprintf(tmp, "mindi --makemountlist %s/mountlist.txt.test", bkpinfo->tmpdir); 1230 if (run_program_and_log_output(tmp, 5)) { 1231 sprintf(tmp, "mindi --makemountlist %s/mountlist.txt.test failed for some reason.", bkpinfo->tmpdir); 1232 log_to_screen(tmp); 1233 1233 log_to_screen 1234 1234 ("Please run that command by hand and examine /var/log/mindi.log"); … … 1494 1494 return (1); 1495 1495 } 1496 strcpy(tempfile, 1497 call_program_and_get_last_line_of_output 1498 ("mktemp -q /tmp/mojo-jojo.blah.XXXXXX")); 1496 sprintf(tempfile, "%s/mojo-jojo.blah", bkpinfo->tmpdir); 1499 1497 if (does_file_exist(config_file)) { 1500 1498 sprintf(command, "grep -vE '^%s .*$' %s > %s", -
branches/2.2.5/mondo/src/common/libmondo-verify.c
r1316 r1644 395 395 bkpinfo->restore_path, 396 396 biggiestruct.filename); 397 asprintf(&tmp, "echo \"%s/%s not found\" >> /tmp/biggies.changed",397 asprintf(&tmp, "echo \"%s/%s not found\" >> %s/biggies.changed", 398 398 bkpinfo->restore_path, 399 biggiestruct.filename); 399 biggiestruct.filename, 400 bkpinfo->tmpdir); 400 401 system(tmp); 401 402 paranoid_free(tmp); … … 786 787 biggie_fname); 787 788 log_to_screen(tmp); 788 sprintf(tmp, "echo \"%s\" >> /tmp/biggies.changed",789 biggie_fname );789 sprintf(tmp, "echo \"%s\" >> %s/biggies.changed", 790 biggie_fname, bkpinfo->tmpdir); 790 791 system(tmp); 791 792 } … … 1181 1182 /* close tape; exit */ 1182 1183 // fclose(g_tape_stream); <-- not needed; is handled by closein_tape() 1183 paranoid_system 1184 ("rm -f /tmp/biggies.changed /tmp/changed.files.[0-9]* 2> /dev/null"); 1185 sprintf(changed_files_fname, "/tmp/changed.files.%d", 1186 (int) (random() % 32767)); 1184 sprintf(tmp, "rm -f %s/biggies.changed %s/changed.files 2> /dev/null", bkpinfo->tmpdir, bkpinfo->tmpdir); 1185 paranoid_system(tmp); 1186 sprintf(changed_files_fname, "%s/changed.files", bkpinfo->tmpdir); 1187 1187 sprintf(tmp, 1188 1188 "grep -E '^%s:.*$' %s | cut -d'\"' -f2 | sort -u | awk '{print \"/\"$0;};' | tr -s '/' '/' | grep -v \"(total of\" | grep -v \"incheckentry.*xwait\" | grep -vE '^/afio:.*$' | grep -vE '^dev/.*$' > %s", … … 1201 1201 } 1202 1202 } 1203 sprintf(tmp, "cat /tmp/biggies.changed >> %s", changed_files_fname);1203 sprintf(tmp, "cat %s/biggies.changed >> %s", bkpinfo->tmpdir, changed_files_fname); 1204 1204 paranoid_system(tmp); 1205 1205 1206 1206 diffs = count_lines_in_file(changed_files_fname); 1207 1207 if (diffs > 0) { 1208 sprintf(tmp, "cp -f %s %s ", changed_files_fname,1209 "/tmp/changed.files");1208 sprintf(tmp, "cp -f %s %s/changed.files", changed_files_fname, 1209 MINDI_CACHE); 1210 1210 run_program_and_log_output(tmp, FALSE); 1211 1211 sprintf(tmp, 1212 "%ld files differed from live filesystem; type less %s or less %s to see",1213 diffs, changed_files_fname, "/tmp/changed.files");1212 "%ld files differed from live filesystem; type less %s or less %s/changed.files to see", 1213 diffs, changed_files_fname, MINDI_CACHE); 1214 1214 log_msg(0, tmp); 1215 log_to_screen 1216 ("See /tmp/changed.files for a list of nonmatching files."); 1217 log_to_screen 1218 ("The files probably changed on filesystem, not on backup media."); 1215 log_to_screen("See "MINDI_CACHE"/changed.files for a list of nonmatching files."); 1216 log_to_screen("The files probably changed on filesystem, not on backup media."); 1219 1217 // retval++; 1220 1218 } -
branches/2.2.5/mondo/src/common/newt-specific.c
r1463 r1644 437 437 438 438 printf("---FATALERROR--- %s\n", error_string); 439 sprintf(command, "gzip -9c %s > /tmp/MA.log.gz 2> /dev/null", MONDO_LOGFILE);439 sprintf(command, "gzip -9c %s > %s/MA.log.gz 2> /dev/null", MONDO_LOGFILE, MINDI_CACHE); 440 440 system(command); 441 441 printf … … 445 445 ("The list's members can help you, if you attach that file to your e-mail.\n"); 446 446 printf("Log file: %s\n", MONDO_LOGFILE); 447 if (does_file_exist("/tmp/MA.log.gz")) { 448 printf 449 ("FYI, I have gzipped the log and saved it to /tmp/MA.log.gz\n"); 447 if (does_file_exist(MINDI_CACHE"/MA.log.gz")) { 448 printf("FYI, I have gzipped the log and saved it to "MINDI_CACHE"/MA.log.gz.\n"); 450 449 } 451 450 printf("Mondo has aborted.\n"); -
branches/2.2.5/mondo/src/mondoarchive/main.c
r1437 r1644 506 506 } 507 507 508 509 if (length_of_file("/tmp/changed.files") > 2) { 508 if (length_of_file(MINDI_CACHE"/changed.files") > 2) { 510 509 if (g_text_mode) { 511 log_to_screen 512 ("Type 'less /tmp/changed.files' to see which files don't match the archives"); 513 } else { 514 log_msg(1, 515 "Type 'less /tmp/changed.files' to see which files don't match the archives"); 510 log_to_screen("Type 'less "MINDI_CACHE"/changed.files' to see which files don't match the archives"); 511 } else { 512 log_msg(1, "Type 'less "MINDI_CACHE"/changed.files' to see which files don't match the archives"); 516 513 log_msg(2, "Calling popup_changelist_from_file()"); 517 popup_changelist_from_file( "/tmp/changed.files");514 popup_changelist_from_file(MINDI_CACHE"/changed.files"); 518 515 log_msg(2, "Returned from popup_changelist_from_file()"); 519 516 } 520 517 } else { 521 unlink( "/tmp/changed.files");518 unlink(MINDI_CACHE"/changed.files"); 522 519 } 523 520 log_to_screen(say_at_end); … … 529 526 530 527 system("rm -f /var/cache/mondo-archive/last-backup.aborted"); 531 system("rm -Rf /tmp.mondo.* /mondo.scratch.*");532 528 if (!retval) { 533 529 printf("Mondoarchive ran OK.\n"); … … 540 536 chdir("/tmp"); // just in case there's something wrong with g_erase_tmpdir_and_scratchdir 541 537 system(g_erase_tmpdir_and_scratchdir); 538 539 /* assemble comand string for deletion of Mondo's tmp directory */ 540 sprintf(tmp, "rm -Rf %s", bkpinfo->tmpdir); 541 542 542 free_libmondo_global_strings(); 543 543 paranoid_free(say_at_end); 544 paranoid_free(tmp);545 544 paranoid_free(bkpinfo); 546 547 unlink("/tmp/filelist.full");548 unlink("/tmp/filelist.full.gz");549 545 550 546 if (!g_cdrom_drive_is_here) { … … 557 553 /* finalize log file with time stamp */ 558 554 log_msg(0, "Time finished: %s", mr_date()); 555 556 /* remove Mondo's tmp directory */ 557 system(tmp); 558 paranoid_free(tmp); 559 559 560 560 if (!g_text_mode) { -
branches/2.2.5/mondo/src/mondorestore/mondo-restore.c
r1612 r1644 3279 3279 /* clean up at the end */ 3280 3280 if (retval) { 3281 if (does_file_exist( "/tmp/changed.files")) {3281 if (does_file_exist(MINDI_CACHE"/changed.files")) { 3282 3282 log_to_screen 3283 ("See /tmp/changed.files for list of files that have changed.");3283 ("See "MINDI_CACHE"/changed.files for list of files that have changed."); 3284 3284 } 3285 3285 mvaddstr_and_log_it(g_currentY++, -
branches/2.2.5/mondo/src/mondorestore/mondo-rstr-compare.c
r1630 r1644 202 202 log_msg(1, tmp_ptr); 203 203 if (retval) { 204 if (!(fout = fopen( "/tmp/changed.txt", "a"))) {204 if (!(fout = fopen(MINDI_CACHE"/changed.txt", "a"))) { 205 205 fatal_error("Cannot openout changed.txt"); 206 206 } … … 381 381 if (length_of_file(logfile) > 5) { 382 382 sprintf(command, 383 "sed s/': \\\"'/\\|/ %s | sed s/'\\\": '/\\|/ | cut -d'|' -f2 | sort -u | grep -vE \"^dev/.*\" >> /tmp/changed.txt",383 "sed s/': \\\"'/\\|/ %s | sed s/'\\\": '/\\|/ | cut -d'|' -f2 | sort -u | grep -vE \"^dev/.*\" >> "MINDI_CACHE"/changed.txt", 384 384 logfile); 385 385 system(command); … … 542 542 getcwd(new, MAX_STR_LEN - 1); 543 543 insist_on_this_cd_number(bkpinfo, g_current_media_number); 544 unlink( "/tmp/changed.txt");544 unlink(MINDI_CACHE"/changed.txt"); 545 545 546 546 resA = compare_all_tarballs(bkpinfo); 547 547 resB = compare_all_biggiefiles(bkpinfo); 548 548 chdir(cwd); 549 noof_changed_files = count_lines_in_file( "/tmp/changed.txt");549 noof_changed_files = count_lines_in_file(MINDI_CACHE"/changed.txt"); 550 550 if (noof_changed_files) { 551 551 sprintf(tmp, "%ld files do not match the backup ", … … 553 553 // mvaddstr_and_log_it( g_currentY++, 0, tmp ); 554 554 log_to_screen(tmp); 555 sprintf(command, "cat /tmp/changed.txt >> %s", MONDO_LOGFILE);555 sprintf(command, "cat "MINDI_CACHE"/changed.txt >> %s", MONDO_LOGFILE); 556 556 paranoid_system(command); 557 557 } else { … … 641 641 } 642 642 643 if (count_lines_in_file( "/tmp/changed.txt") > 0) {643 if (count_lines_in_file(MINDI_CACHE"/changed.txt") > 0) { 644 644 mvaddstr_and_log_it(g_currentY++, 0, 645 645 "Differences found while files were being compared."); 646 streamline_changes_file( "/tmp/changed.files", "/tmp/changed.txt");647 if (count_lines_in_file( "/tmp/changed.files") <= 0) {646 streamline_changes_file(MINDI_CACHE"/changed.files", MINDI_CACHE"/changed.txt"); 647 if (count_lines_in_file(MINDI_CACHE"/changed.files") <= 0) { 648 648 mvaddstr_and_log_it(g_currentY++, 0, 649 649 "...but they were logfiles and temporary files. Your archives are fine."); … … 651 651 ("The differences were logfiles and temporary files. Your archives are fine."); 652 652 } else { 653 q = count_lines_in_file( "/tmp/changed.files");653 q = count_lines_in_file(MINDI_CACHE"/changed.files"); 654 654 sprintf(tmp, "%ld significant difference%s found.", q, 655 655 (q != 1) ? "s" : ""); … … 666 666 chdir(bkpinfo->restore_path); 667 667 getcwd(new, MAX_STR_LEN - 1); 668 popup_changelist_from_file( "/tmp/changed.files");668 popup_changelist_from_file(MINDI_CACHE"/changed.files"); 669 669 chdir(cwd); 670 670 log_msg(2, "Returning from popup_changelist_from_file()"); … … 723 723 res = verify_tape_backups(bkpinfo); 724 724 chdir(dir); 725 if (length_of_file( "/tmp/changed.txt") > 2726 && length_of_file( "/tmp/changed.files") > 2) {725 if (length_of_file(MINDI_CACHE"/changed.txt") > 2 726 && length_of_file(MINDI_CACHE"/changed.files") > 2) { 727 727 log_msg(0, 728 "Type 'less /tmp/changed.files' to see which files don't match the archives");728 "Type 'less "MINDI_CACHE"/changed.files' to see which files don't match the archives"); 729 729 log_msg(2, "Calling popup_changelist_from_file()"); 730 popup_changelist_from_file( "/tmp/changed.files");730 popup_changelist_from_file(MINDI_CACHE"/changed.files"); 731 731 log_msg(2, "Returned from popup_changelist_from_file()"); 732 732 } -
branches/2.2.5/mondo/src/mondorestore/mondorestore.h
r1318 r1644 8 8 * Compatibility #define to ease the transition to logfile-in-a-variable. 9 9 */ 10 char *MONDO_LOGFILE = "/ tmp/mondorestore.log";10 char *MONDO_LOGFILE = "/var/log/mondorestore.log"; 11 11 12 12 /* Busybox ps has no option and PID in first pos */
Note:
See TracChangeset
for help on using the changeset viewer.