1

I have mistakenly deleted some useful data from my backup file but the problem is I have so far analyzed huge amount of backup file and now i cannot take a another backup and start analyzing from first so can linux community help me on this. This is file format

ORDER ALPHA

Facility: 201  ZZZ        COUNTRY
Wrong Trace:       Kotak: NA       Soak: NA        NOUN: XP

                  O  O  O  O  O  O  O  O  O  O  O  O  O  O
                  O  O  O  O  O  O  O  O  O  O  O  O  O  O   LAM
AMO ORDER #   P/P R  O  L  H  S  C  N  D  K  M  D  D  C  N   LAM uii ii oo
--- --------  --- -- -- -- -- -- -- -- -- -- -- -- -- -- --  --- --- -- --

    BZ90rty   K/K AA AA AA NA XP AP NA NA NA NA NA NA AP AP  OOL XP  IP N
a      ZX     A/A WD WD WD NA WD WD NA NA NA NA NA NA WD WD  OOL WD  IP Y
ORDER BURY

Facility: 201  ZZZ        COUNTRY
Wrong Trace:       Kotak: NA       Soak: NA        NOUN: XP

                  O  O  O  O  O  O  O  O  O  O  O  O  O  O
                  O  O  O  O  O  O  O  O  O  O  O  O  O  O   LAM
AMO ORDER #   P/P R  O  L  H  S  C  N  D  K  M  D  D  C  N   LAM uii ii oo
--- --------  --- -- -- -- -- -- -- -- -- -- -- -- -- -- --  --- --- -- --

    BZ903901  A/A AA AA AA NA XP AP NA NA NA NA NA NA AP AP  OOL XP  IP N
a      ZX     D/A WD WD WD NA WD WD NA NA NA NA NA NA WD WD  OOL WD  IP Y

ORDER ALUIO

I have deleted

ORDER ALPHA

Facility: 201  ZZZ        COUNTRY
Wrong Trace:       Kotak: NA       Soak: NA        NOUN: XP

                  O  O  O  O  O  O  O  O  O  O  O  O  O  O
                  O  O  O  O  O  O  O  O  O  O  O  O  O  O   LAM
AMO ORDER #   P/P R  O  L  H  S  C  N  D  K  M  D  D  C  N   LAM uii ii oo
--- --------  --- -- -- -- -- -- -- -- -- -- -- -- -- -- --  --- --- -- --

    BZ90rty   D/D AA AA AA NA XP AP NA NA NA NA NA NA AP AP  OOL XP  IP N
a      ZX     D/D WD WD WD NA WD WD NA NA NA NA NA NA WD WD  OOL WD  IP Y

like this only ORDER XXXXX number changes but condition remains same Case 1: (IF NOUN :XP && D/D above D/D) add these data from original file to Backup file. NOTE:Original file has these Case 1:deleted data ,add these data back to Backupfile(where backup files states mistakenly deleted case 1 data). Simple flow---->either rsync or cp or sed or awk and append case 1 data from original file to backup file again.

closed as unclear what you're asking by roaima, Scott, Michael Homer, Philippos, Rui F Ribeiro May 13 at 18:40

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    I have no idea what you want to achieve. – Michael Vehrs Mar 6 '17 at 10:57
  • It is very simple please go through the question,I have deleted some data from file Backup the deleted data is shown above and i want to copy the type of deleted data back from original file to backup file.(overview) – chandu Mar 6 '17 at 12:09
0

I did not get, in which form exacly is (a) your original data, (b) your - possibly corrupted - backup data, and (c) did you in any way prepare a file containaning the missing data, that would complete the corrupted backup data.

But here are suggestions:

$ cat missing_data corrupted_data > corrected_backup_data

or

$ diff original_data corrupted_data > missing_data.patch

and then

$ patch corrupted_data missing_data.patch

Regards, Micha

Not the answer you're looking for? Browse other questions tagged or ask your own question.