Muffinresearch Labs by Stuart Colville

Extracting a single file from a tar backup | Comments (1)

Posted in Code, Linux/Unix on 12th November 2007, 12:49 am by Stuart

Like an idiot I accidentally overwrote a file for this blog when uploading some other stuff; accidents happen. Anyway, I have backups (you do have backups right?) and I needed to grab a single file out of the latest tar. Fortunately this is really straight forward and rather than unpacking the entire backup of all sites + dbs just to get one file you can use something like this:

tar -xf backup.1194753607.tar --wildcards *blah/index.php

As the manual states the wildcards flag enables globbing. Here’s a quick hack to flatten the output. Instead of creating the directory structure the -O flag is used to send the output to stdout and then redirect that output into the file index.php.

tar -xf backup.1194753607.tar -O --wildcards *blah/index.php > index.php

Post Tools

Comments: Add yours

1. On November 13th, 2007 at 1:29 am Nothing To Say » Blog Archive » links for 2007-11-13 said:

[...] Extracting a single file from a tar backup (tags: linux, tar, backup) [...]







XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>



Using Loggerhead with mod_wsgi|(0)

Here’s a post I wrote over on the Project Fondue Blog about our use of Loggerhead with mod_wsgi under Apache. Loggerhead is the rather nice branch viewer for bazaar branches as used on Launchpad.net.

If you’re not already subscribed to the Project Fondue blog feed then I can recommend it, as there should be some interesting posts coming out of there in the coming months (yes I’m unashamedly biased!).

Ubuntu: Turn off changing workspace with mouse wheel|(1)

I found the changing with the workspace with the mouse wheel really annoying. To disable it go to System => Preferences => CompizConfig (available if the compizconfig-settings-manager package is installed) and uncheck “Viewport Switcher” which is under the “Desktop” heading.

Photos on Flickr

© Copyright 2004-10 Stuart Colville, all rights reserved. May contain traces of Muffin. Powered by WordPress. Hosting by Slicehost.com This page was baked in 0.476s.