Paul's Internet Landfill/ 2010/ Using mtftar

Using mtftar

At work I do Windows backups with that old (deprecated) standby NTBackup. This generates large .bkf files. As a second stage backup I transfer these files to a server running Linux.

Unfortunately when I needed to restore a file from these archived backups I moved the file back to its Windows server, which took a long time. Fortunately, there is a better way. KWLUG member Colin Mackay pointed me to [mtftar]http://gpl.internetconnection.net/, which has some documentation in this blog post: http://savvyadmin.com/extract-nt-backup-files-in-linux-using-mtftar/ . Unfortunately neither the source nor the blog post contained the examples I needed to cut and paste into to restore a specific folder of files, so I will document how I used the program here:

First, I compiled the program as documented in the blog post. Then I listed the files in the archive:

mtftar < backup.bkf | tar tvf - | grep 'Love Letters'

to tell me the location of the Love Letters directory. Say that I get the following back:

C:/Documents and Settings/pnijjar/Love Letters/Margaret Thatcher.txt
C:/Documents and Settings/pnijjar/Love Letters/Ayn Rand.txt
C:/Documents and Settings/pnijjar/Love Letters/Brian Mulroney.txt
C:/Documents and Settings/pnijjar/Love Letters/Ayn Rand 2.txt
C:/Documents and Settings/pnijjar/Love Letters/Ayn Rand 3.txt
C:/Documents and Settings/pnijjar/Love Letters/Stockwell Day.txt
C:/Documents and Settings/pnijjar/Love Letters/Richard Dawkins.tzt

Now to extract the entire archive of letters as follows:

mtftar < backup.bkf | tar xvf - 'C:/Documents and Settings/pnijjar/Love Letters' 

This will create a folder hierarchy containing Love Letters and all of its contents. Be careful not to overwrite files you want to keep! You might want to extract these files in /tmp somewhere.

I guess this should be obvious to anybody who is familiar with tar, but it took me a while to realize that mtftar doesn't do extraction on its own -- tar does all of the extraction work, and it finds the files to extract from the archive.