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>



Standalone mac battery charger|(0)

Got a spare mac battery? I’ve often wondered why up until now no-one’s produced a standalone charger so that you can charge batteries without having to plug them into the mac. Fortunately Fastmac.com have produced a standalone charger that allows you to do just that. and it’s compatible with iBooks, Powerbooks, macbooks and Macbook Pros. It’s also 110/200v. Exactly what I was looking for!

Django Admin Ominigraffle Stencil|(0)

Colleague Alex Lee has created a nice stencil for omingraffle with the Django Admin UI components, perfect for wireframing customised admin screens. For more details and to download the stencil see Alex’s Blog csensedesign.co.uk

Photos on Flickr

© Copyright 2004-08 Stuart Colville, all rights reserved. May contain traces of Muffin. Powered by WordPress. Hosting by 1&1 This page was baked in 0.714s.