idle
idle

Reputation: 1137

One-way diff file

I would like to generate diffs for the sake of doing incremental backups of an sql database.

Using the standard unix 'diff' tool generates unnecessarily large files, since they include the full text of deleted lines. I only need support to be able to patch in one direction (to generate the current db dump from the full dump and an incremental patch).

How would I go about doing this? I have tried so far using diff -e and patch -e, but it doesn't seem to be working correctly, as the resulting file is corrupt (possibly an issue with the 'ed' tool used in cygwin)

Upvotes: 0

Views: 1585

Answers (1)

Tilo
Tilo

Reputation: 33742

back in the old days, before Vim, there used to be a line-oriented UNIX editor called 'ed' ..

diff has an option built in ( -e option ) , with which you can create an edit script from the diff.

Check here: and look for the section "Edit Script"

http://en.wikipedia.org/wiki/Diff

http://docs.freebsd.org/info/diff/diff.info.ed_Scripts.html

here's an example:

http://www.araxis.com/merge/topic_diff_report_editscript.html


another way to do this is to create a patch file (see 'man patch')

Upvotes: 1

Related Questions