Changes

Jump to navigation Jump to search
106 bytes added ,  23:10, 5 May 2009
changed to reflect repeated tests showing that tar is safe and doesn't nuke subdirectories
The magic tar one-line command to unpack a Drupal distribution over an
existing Drupal directory (without nuking clobbering your "sites" directory) - but keep reading!
<source lang="bash">
tar x --show-omitted-dirs --exclude sites --directory ../work/gr/iic-drupal/ \
</source>
--
Drupal ships a tarball with the first object being a directory named
after the release (e.g. drupal-6.11/)
tar x --directory ~/existing-drupal --strip 1 -zf drupal-6.11.tar.gz
</source>
But wait!! that command will still overwrite your existing "sites"directory which is where you are supposed to store all your;<code>--strip 1</code> : removes the first path component of objects in the tar archivecustomizations to Drupal ;<code>-- and you don't want directory</code> : tells tar to change to do that. Therecommended procedure is a particular directory prior to make backups extracting the contents of your the archive If you're upgrading a Drupal instance, then you already have a "sites" directory andthen copy it back into the distribution that you unpack. I think abetter way is to You can skip over the sites this directory. Don't even extract itfrom in the tar archive. You can do this with the '''exclude''' option. In
fact, you can even have tar show you what you have skipped over with
the '''show-omitted-dirs''' option. So, the best way that I know how to
</source>
This didn't mess with my .git directory, .gitignore file and another
top-level file I had called "crossdomain.xml" but it still nuked  == Warning =={{Messagebox ||type=warning|text = Although I could not reproduce this behavior, I did once get my"sites" directory :-(deleted. So, you do have [[backups]] and use [[version control]] right?}}
I restored it with
== Documentation ==
There is a '''lot''' more option information in the '''<code>tar --help</code> ''' outputthan in the man page. Of course if you <code>sudo apt-get install tar-doc</code> then you can view the info manual. The "info" manual is also online at http://www.gnu.org/software/tar/manual/tar.html providing full documentation for tar. I'll have to test --keep-newer-files to see if that works.  
== Alternatives ==
4,558

edits

Navigation menu