Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

tar -x without clobbering directories



I was trying to unpack a Drupal distribution (which is provided as a
tar archive) without overwriting nor erasing an existing subdirectory
(called "sites") and found that even when using --exclude I would not
get the intended result.

The archive contains a basic "sites" directory which is where you are
supposed to maintain your customizations -- so when upgrading you want
to preserve the existing "sites" directory.  I know that I can move it
out of the way, but wanted to be a bit more intelligent about it
because there may be other files that are newer in the target
directory, or even non-existant in the archive.   In other words, I
wanted a better way than the recommended "make a backup of your
current installation, untar the new software; add back your relevant
files.  And, I didn't want to use the -w, --interactive,
--confirmation (ask for confirmation for every action) option to tar
because I don't want to confirm hundreds of actions.

I solved my problem pretty easily because my "other changes" were
confined to the top-level directory, and my "sites" directory was in
git so I just checked it out of git after it was clobbered.

I wrote it up here: http://freephile.com/wiki/index.php/Tar

I kept checking The Google for answers, and found another Tape Archive
program called S-tar which apparently does exactly what I was trying
to do: namely not clobber existing directories in an intelligent
manner.  Looking at the project page, and man page, it has a large
number of useful features.  Anyone use it?

http://freshmeat.net/projects/star/

-- 
Greg Rundlett
Web Developer - Initiative in Innovative Computing
http://iic.harvard.edu
camb 617-384-5872
nbpt 978-225-8302
m. 978-764-4424
-skype/aim/irc/twitter freephile
http://profiles.aim.com/freephile






BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org