- Timestamp:
- Sep 25, 2007, 12:54:32 AM (18 years ago)
- Location:
- branches/2.2.5/mondo/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.5/mondo/src/common/libmondo-devices.c
r1646 r1655 2516 2516 strcpy(tmp, 2517 2517 call_program_and_get_last_line_of_output 2518 (" df -m -P -t nonfs,msdosfs,ntfs,smbfs,smb,cifs,afs,ocfs,ocfs2,mvfs | tr -s '\t' ' ' | grep -vE \"none|Filesystem\" | awk '{printf \"%s %s\\n\", $4, $6;}' | sort -n | tail -n1 | awk '{print $NF;}'"));2518 ("LANGUAGE=C df -m -P -t nonfs,msdosfs,ntfs,smbfs,smb,cifs,afs,ocfs,ocfs2,mvfs | tr -s '\t' ' ' | grep -vE \"none|Filesystem\" | awk '{printf \"%s %s\\n\", $4, $6;}' | sort -n | tail -n1 | awk '{print $NF;}'")); 2519 2519 #else 2520 2520 strcpy(tmp, 2521 2521 call_program_and_get_last_line_of_output 2522 (" df -m -P -x nfs -x vfat -x ntfs -x smbfs -x smb -x cifs -x afs -x ocfs -x ocfs2 -x mvfs | sed 's/ /devdev/' | tr -s '\t' ' ' | grep -vE \"none|Filesystem|/dev/shm\" | awk '{printf \"%s %s\\n\", $4, $6;}' | sort -n | tail -n1 | awk '{print $NF;}'"));2522 ("LANGUAGE=C df -m -P -x nfs -x vfat -x ntfs -x smbfs -x smb -x cifs -x afs -x ocfs -x ocfs2 -x mvfs | sed 's/ /devdev/' | tr -s '\t' ' ' | grep -vE \"none|Filesystem|/dev/shm\" | awk '{printf \"%s %s\\n\", $4, $6;}' | sort -n | tail -n1 | awk '{print $NF;}'")); 2523 2523 #endif 2524 2524 … … 2531 2531 fatal_error("I couldn't figure out the tempdir!"); 2532 2532 } 2533 sprintf(bkpinfo->tmpdir, "%s/tmp.mondo.%d", tmp, 2534 (int) (random() % 32768)); 2533 setup_tmpdir(tmp); 2535 2534 log_it("bkpinfo->tmpdir is being set to %s", bkpinfo->tmpdir); 2536 2535 -
branches/2.2.5/mondo/src/common/libmondo-tools.c
r1654 r1655 617 617 } 618 618 make_hole_for_dir(bkpinfo->scratchdir); 619 make_hole_for_dir(bkpinfo->tmpdir);620 619 if (bkpinfo->backup_media_type == iso) 621 620 make_hole_for_dir(bkpinfo->isodir); … … 902 901 } 903 902 chmod(bkpinfo->scratchdir, 0700); 904 chmod(bkpinfo->tmpdir, 0700);905 903 g_backup_media_type = bkpinfo->backup_media_type; 906 904 paranoid_free(mtpt); … … 963 961 } 964 962 965 void setup_tmpdir( ) {963 void setup_tmpdir(char *path) { 966 964 967 965 char *tmp = NULL; 968 966 char *p = NULL; 969 967 968 if (bkpinfo->tmpdir != NULL) { 969 /* purging a potential old tmpdir */ 970 asprintf(&tmp,"rm -Rf %s",bkpinfo->tmpdir); 971 run_program_and_log_output(tmp, FALSE); 972 paranoid_free(tmp); 973 } 974 970 975 if (getenv("TMPDIR")) { 971 976 asprintf(&tmp, "%s/mondo.tmp.XXXXXX", getenv("TMPDIR")); 972 977 } else if (getenv("TMP")) { 973 978 asprintf(&tmp, "%s/mondo.tmp.XXXXXX", getenv("TMP")); 979 } else if (path != NULL) { 980 asprintf(&tmp, "%s/mondo.tmp.XXXXXX", path); 974 981 } else { 975 982 asprintf(&tmp, "/tmp/mondo.tmp.XXXXXX"); -
branches/2.2.5/mondo/src/mondoarchive/mondo-cli.c
r1645 r1655 244 244 flag_set[i] = FALSE; 245 245 } 246 // strcpy (bkpinfo->tmpdir, "/root/images/mondo");247 246 // strcpy (bkpinfo->scratchdir, "/home"); 248 247 for (j = 1; j <= MAX_NOOF_MEDIA; j++) { … … 273 272 sprintf(tmp, "rm -Rf %s/mondo.scratch.*", bkpinfo->scratchdir); 274 273 paranoid_system(tmp); 275 sprintf(bkpinfo->tmpdir + strlen(bkpinfo->tmpdir), "/tmp.mondo.%ld",276 random() % 32767);277 274 sprintf(bkpinfo->scratchdir + strlen(bkpinfo->scratchdir), 278 275 "/mondo.scratch.%ld", random() % 32767); … … 853 850 } 854 851 if (flag_set['T']) { 855 sprintf(bkpinfo->tmpdir, "%s/tmp.mondo.%ld", flag_val['T'], 856 random() % 32768); 857 sprintf(tmp, "touch %s/.foo.dat", flag_val['T']); 852 setup_tmpdir(flag_val['T']); 853 sprintf(tmp, "touch %s/.foo.dat", bkpinfo->tmpdir); 858 854 if (run_program_and_log_output(tmp, 1)) { 859 855 retval++; … … 862 858 fatal_error("I cannot write to the tempdir you specified."); 863 859 } 864 sprintf(tmp, "ln -sf %s/.foo.dat %s/.bar.dat", flag_val['T'], 865 flag_val['T']); 860 sprintf(tmp, "ln -sf %s/.foo.dat %s/.bar.dat", bkpinfo->tmpdir, bkpinfo->tmpdir); 866 861 if (run_program_and_log_output(tmp, 1)) { 867 862 retval++;
Note:
See TracChangeset
for help on using the changeset viewer.