Changeset 273 in MondoRescue for branches/2.06/mondo/mondo/common
- Timestamp:
- Jan 3, 2006, 4:09:12 PM (18 years ago)
- Location:
- branches/2.06/mondo/mondo/common
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.06/mondo/mondo/common/X-specific.cpp
r30 r273 197 197 kapp->quit(); 198 198 printf ("---FATAL ERROR--- %s\n", error); 199 system (" cat /var/log/mondo-archive.log | gzip -9> /tmp/MA.log.gz 2> /dev/null");199 system ("gzip -9c /var/log/mondo-archive.log > /tmp/MA.log.gz 2> /dev/null"); 200 200 printf ("If you require technical support, please contact the mailing list.\n"); 201 201 printf ("See http://www.mondorescue.org for details.\n"); … … 252 252 if (grep_for_me[0] != '\0') 253 253 { 254 sprintf (command, " cat %s | grep \"%s\" | tail -n%d", filename,255 grep_for_me, NOOF_ERR_LINES);254 sprintf (command, "grep \"%s\" %s | tail -n%d", 255 grep_for_me, filename, NOOF_ERR_LINES); 256 256 } 257 257 else 258 258 { 259 sprintf (command, " cat %s | tail -n%d", filename, NOOF_ERR_LINES);259 sprintf (command, "tail -n%d %s", NOOF_ERR_LINES, filename); 260 260 } 261 261 fin = popen (command, "r"); -
branches/2.06/mondo/mondo/common/libmondo-devices.c
r256 r273 1437 1437 #else 1438 1438 sprintf(command, 1439 " cat /proc/filesystems | grep -v nodev| tr -s '\t' ' ' | cut -d' ' -f2 | tr -s '\n' ' '");1439 "grep -v nodev /proc/filesystems | tr -s '\t' ' ' | cut -d' ' -f2 | tr -s '\n' ' '"); 1440 1440 #endif 1441 1441 -
branches/2.06/mondo/mondo/common/libmondo-filelist.c
r128 r273 656 656 if (find_home_of_exe("setfacl")) 657 657 { 658 sprintf(command, " cat %s | gzip -dc| setfacl --restore - 2>> %s", acl_fname, MONDO_LOGFILE);658 sprintf(command, "gzip -dc %s | setfacl --restore - 2>> %s", acl_fname, MONDO_LOGFILE); 659 659 log_msg(1, "command = %s", command); 660 660 retval = system(command); … … 685 685 log_msg(1, 686 686 "No masklist provided. I shall therefore set ALL attributes."); 687 sprintf(command, " cat %s | gzip -dc| %s --restore - 2>> %s",687 sprintf(command, "gzip -dc %s | %s --restore - 2>> %s", 688 688 original_exat_fname, executable, MONDO_LOGFILE); 689 689 log_msg(1, "command = %s", command); … … 712 712 sort_file(masklist); 713 713 current_subset_file[0] = current_master_file[0] = '\0'; 714 sprintf(syscall_pin, " cat %s | gzip -dc", original_exat_fname);714 sprintf(syscall_pin, "gzip -dc %s", original_exat_fname); 715 715 sprintf(syscall_pout, "%s --restore - 2>> %s", executable, 716 716 MONDO_LOGFILE); … … 833 833 if (find_home_of_exe("setfattr")) 834 834 { 835 sprintf(command, " cat %s | gzip -dc| setfattr --restore - 2>> %s", acl_fname, MONDO_LOGFILE);835 sprintf(command, "gzip -dc %s | setfattr --restore - 2>> %s", acl_fname, MONDO_LOGFILE); 836 836 log_msg(1, "command = %s", command); 837 837 retval = system(command); -
branches/2.06/mondo/mondo/common/libmondo-files.c
r234 r273 845 845 sprintf(mountlist, "%s/mountlist.txt", tmpdir); 846 846 sprintf(command, 847 " cat %s/mountlist.txt | grep \"%s \" | head -n1 | awk '{print $4;}'",848 tmpdir, dev);847 "grep \"%s \" %s/mountlist.txt | head -n1 | awk '{print $4}'", 848 dev, tmpdir); 849 849 log_it(command); 850 850 strcpy(sz_res, call_program_and_get_last_line_of_output(command)); -
branches/2.06/mondo/mondo/common/libmondo-raid.c
r128 r273 80 80 81 81 command = malloc(MAX_STR_LEN * 2); 82 strcpy(command, " cat /proc/mdstat | grep \"");82 strcpy(command, "grep \" /proc/mdstat"); 83 83 if (raidno == -1) { 84 84 strcat(command, "linear"); -
branches/2.06/mondo/mondo/common/libmondo-tools.c
r196 r273 335 335 "for i in `find /root /home -type d -name Desktop -maxdepth 2`; do \ 336 336 file=$i/.directory; if [ -f \"$file\" ] ; then mv -f $file $file.old ; \ 337 cat $file.old |awk '{if (index($0, \"rootimagesmindi\")) { while (length($0)>2) { getline;} ; } \338 else { print $0;};}' > $file ; fi ; done");337 awk '{if (index($0, \"rootimagesmindi\")) { while (length($0)>2) { getline;} ; } \ 338 else { print $0;};}'$file.old > $file ; fi ; done"); 339 339 run_program_and_log_output(tmp, 5); 340 340 paranoid_free(tmp); … … 1098 1098 #ifndef __FreeBSD__ 1099 1099 if (run_program_and_log_output 1100 (" cat /proc/devices | grep ramdisk", FALSE)) {1100 ("grep ramdisk /proc/devices", FALSE)) { 1101 1101 if (!ask_me_yes_or_no 1102 1102 ("Your kernel has no ramdisk support. That's mind-numbingly stupid but I'll allow it if you're planning to use a failsafe kernel. Are you?")) … … 1390 1390 log_msg(4, "Done. Great. Seeting command to something"); 1391 1391 strcpy(command, 1392 " cat /etc/fstab | grep -v \":\"| grep -vx \"#.*\" | grep -w \"/boot\" | tr -s ' ' '\t' | cut -f1 | head -n1");1392 "grep -v \":\" /etc/fstab | grep -vx \"#.*\" | grep -w \"/boot\" | tr -s ' ' '\t' | cut -f1 | head -n1"); 1393 1393 log_msg(4, "Cool. Command = '%s'", command); 1394 1394 strcpy(tmp, call_program_and_get_last_line_of_output(command)); -
branches/2.06/mondo/mondo/common/libmondo-verify.c
r128 r273 159 159 160 160 /* sprintf (command, 161 " cat %s | grep \"afio: \" | awk '{j=substr($0,8); i=index(j,\": \");printf \"/%%s\\n\",substr(j,1,i-2);}' | sort | uniq| grep -v \"incheckentry.*xwait\" | grep -vx \"/afio:.*\" | grep -vx \"/dev/.*\" > %s",161 "grep \"afio: \" %s | awk '{j=substr($0,8); i=index(j,\": \");printf \"/%%s\\n\",substr(j,1,i-2);}' | sort -u | grep -v \"incheckentry.*xwait\" | grep -vx \"/afio:.*\" | grep -vx \"/dev/.*\" > %s", 162 162 stderr_fname, afio_found_changes); 163 163 */ … … 165 165 log_msg(1, "Now scanning log file for 'afio: ' stuff"); 166 166 sprintf(command, 167 " cat %s | grep \"afio: \"| sed 's/afio: //' | grep -vx \"/dev/.*\" >> %s",167 "grep \"afio: \" %s | sed 's/afio: //' | grep -vx \"/dev/.*\" >> %s", 168 168 stderr_fname, afio_found_changes); 169 169 log_msg(2, command); … … 175 175 log_msg(1, "Now scanning log file for 'star: ' stuff"); 176 176 sprintf(command, 177 " cat %s | grep \"star: \"| sed 's/star: //' | grep -vx \"/dev/.*\" >> %s",177 "grep \"star: \" %s | sed 's/star: //' | grep -vx \"/dev/.*\" >> %s", 178 178 stderr_fname, afio_found_changes); 179 179 log_msg(2, command); … … 185 185 afio_diffs = count_lines_in_file(afio_found_changes); 186 186 sprintf(command, 187 " cat %s %s %s | sort| uniq -c | awk '{ if ($1==\"2\") {print $2;};}' | grep -v \"incheckentry xwait()\" > %s",187 "sort %s %s %s | uniq -c | awk '{ if ($1==\"2\") {print $2;};}' | grep -v \"incheckentry xwait()\" > %s", 188 188 ignorefiles_fname, afio_found_changes, afio_found_changes, 189 189 changedfiles_fname); … … 401 401 g_current_media_number, bigfile_num, slice_num); 402 402 if (bkpinfo->compression_level > 0) { 403 sprintf(command, "cat %s | %s -dc 2>> %s", 403 sprintf(command, "%s -dc %s 2>> %s", 404 sz_exe, 404 405 slice_fname(bigfile_num, slice_num, mountpoint, 405 bkpinfo->zip_suffix), sz_exe,406 bkpinfo->zip_suffix), 406 407 MONDO_LOGFILE); 407 408 } else { … … 543 544 sprintf(command, "cat %s >> %s", outlog, MONDO_LOGFILE); 544 545 } else { 545 sprintf(command, "c at %s | cut -d':' -f%d | sort | uniq", outlog,546 (bkpinfo->use_star) ? 1 : 2 );546 sprintf(command, "cut -d: -f%d %s | sort -u", 547 (bkpinfo->use_star) ? 1 : 2, outlog); 547 548 pin = popen(command, "r"); 548 549 if (pin) { … … 580 581 } 581 582 /* chdir(old_pwd); */ 582 // sprintf (tmp, " cat %s | uniq -u>> %s", "/tmp/mondo-verify.err", MONDO_LOGFILE);583 // sprintf (tmp, "uniq -u %s >> %s", "/tmp/mondo-verify.err", MONDO_LOGFILE); 583 584 // paranoid_system (tmp); 584 585 // unlink ("/tmp/mondo-verify.err"); … … 1148 1149 (int) (random() % 32767)); 1149 1150 sprintf(tmp, 1150 " cat %s | grep -x \"%s:.*\"| cut -d'\"' -f2 | sort -u | awk '{print \"/\"$0;};' | tr -s '/' '/' | grep -v \"(total of\" | grep -v \"incheckentry.*xwait\" | grep -vx \"/afio:.*\" | grep -vx \"dev/.*\" > %s",1151 MONDO_LOGFILE, (bkpinfo->use_star) ? "star" : "afio",1151 "grep -x \"%s:.*\" %s | cut -d'\"' -f2 | sort -u | awk '{print \"/\"$0;};' | tr -s '/' '/' | grep -v \"(total of\" | grep -v \"incheckentry.*xwait\" | grep -vx \"/afio:.*\" | grep -vx \"dev/.*\" > %s", 1152 (bkpinfo->use_star) ? "star" : "afio", MONDO_LOGFILE, 1152 1153 changed_files_fname); 1153 1154 log_msg(2, "Running command to derive list of changed files"); -
branches/2.06/mondo/mondo/common/newt-specific.c
r213 r273 424 424 printf("---FATALERROR--- %s\n", error_string); 425 425 system 426 (" cat /var/log/mondo-archive.log | gzip -9> /tmp/MA.log.gz 2> /dev/null");426 ("gzip -9c /var/log/mondo-archive.log > /tmp/MA.log.gz 2> /dev/null"); 427 427 printf 428 428 ("If you require technical support, please contact the mailing list.\n");
Note:
See TracChangeset
for help on using the changeset viewer.