From greg at freephile.com Tue May 5 13:30:33 2009 From: greg at freephile.com (Greg Rundlett (freephile)) Date: Tue, 5 May 2009 13:30:33 -0400 Subject: [Bostonphptalk] tar -x without clobbering directories Message-ID: <5e2aaca40905051030m16f6381dra422ba37056b68dc@mail.gmail.com> 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 From greg at freephile.com Tue May 5 14:24:59 2009 From: greg at freephile.com (Greg Rundlett (freephile)) Date: Tue, 5 May 2009 14:24:59 -0400 Subject: [Bostonphptalk] tar -x without clobbering directories In-Reply-To: <20090505174509.52F4791805D@c-98-216-200-60.hsd1.ma.comcast.net> References: <5e2aaca40905051030m16f6381dra422ba37056b68dc@mail.gmail.com> <20090505174509.52F4791805D@c-98-216-200-60.hsd1.ma.comcast.net> Message-ID: <5e2aaca40905051124o6663c9ebs2b5dfe3052dd5b81@mail.gmail.com> On Tue, May 5, 2009 at 1:45 PM, Michael ODonnell wrote: > > > My Debian system's tar identifies itself as "tar (GNU tar) 1.22" and > the output generated with --help includes the following excerpt where > that --no-overwrite-dir option sounds like what you wanted: > > ?Overwrite control: > > ?-k, --keep-old-files ? ? ? don't replace existing files when extracting > ? ? ?--keep-newer-files ? ? don't replace existing files that are newer than > ? ? ? ? ? ? ? ? ? ? ? ? ? ? their archive copies > ? ? ?--no-overwrite-dir ? ? preserve metadata of existing directories > ? ? ?--overwrite ? ? ? ? ? ?overwrite existing files when extracting > ? ? ?--overwrite-dir ? ? ? ?overwrite metadata of existing directories when > ? ? ? ? ? ? ? ? ? ? ? ? ? ? extracting (default) > ? ? ?--recursive-unlink ? ? empty hierarchies prior to extracting directory > ? ? ?--remove-files ? ? ? ? remove files after adding them to the archive > ?-U, --unlink-first ? ? ? ? remove each file prior to extracting over it > ?-W, --verify ? ? ? ? ? ? ? attempt to verify the archive after writing it > Thanks. There is a lot more option information in the --help output than in the man page. I wanted to overwrite all directories except "sites" which is why I was hoping --exclude=sites would work. I'll have to test --keep-newer-files to see if that works. http://www.gnu.org/software/tar/manual/tar.html#SEC72 p.s. I read the tar man page (more than once), and those options aren't listed. There is this BUG statement at the bottom: BUGS The GNU folks, in general, abhor man pages, and create info documents instead. Unfortunately, the info document describing tar is licensed under the GFDL with invariant cover texts, which violates the Debian Free Software Guidelines. As a result, the info documentation for tar is not included in the Debian package. If you want to read the complete documentation for GNU tar, please refer to the online version at This man page was created for the Debian distribution. It does not describe all of the functionality of tar, and it is often out of date. Patches to improve the coverage and/or accuracy of this man page are appreciated, and should be filed as wishlist severity bugs against the Debian tar package, not submitted to the GNU tar maintainers. -- 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 From greg at freephile.com Tue May 5 22:45:20 2009 From: greg at freephile.com (Greg Rundlett (freephile)) Date: Tue, 5 May 2009 22:45:20 -0400 Subject: [Bostonphptalk] tar -x without clobbering directories In-Reply-To: <4A009FD6.7050100@sdf.lonestar.org> References: <5e2aaca40905051030m16f6381dra422ba37056b68dc@mail.gmail.com> <20090505174509.52F4791805D@c-98-216-200-60.hsd1.ma.comcast.net> <5e2aaca40905051124o6663c9ebs2b5dfe3052dd5b81@mail.gmail.com> <4A009FD6.7050100@sdf.lonestar.org> Message-ID: <5e2aaca40905051945y4a7c1be2v9e89c08b901df2eb@mail.gmail.com> On Tue, May 5, 2009 at 4:21 PM, Tom McLaughlin wrote: > > > Just curios, are you saying that when extracting Drupal everything under > sites/ is wiped out? ?For example any files created by you and not in the > ?Drupal tarball are gone after extraction? ?That's the sense I got from your > email but could not reproduce on Fedora 10 with tar 1.20. Also > --overwrite-dir does not say it is the default behavior in the man page I > have. > > tom > > -- > | tmclaugh at sdf.lonestar.org ? ? ? ? ? ? ? ? tmclaugh at FreeBSD.org | > | FreeBSD ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? http://www.FreeBSD.org | > > That is what happened...when I used --exclude, it skipped extracting the "sites" directory from the tarball (like I wanted), but also deleted the existing "sites" directory in the target folder as if "that shouldn't be there". I did a git status and sites was gone I just thoroughly retested the exact history from the same machine (plus another machine), and the sites folder does NOT get removed nor clobbered. So it looks like the tar one-liner works but now I can't explain what happened to me the first time around. I even rechecked git status to see if somehow it was an issue with git getting fooled. 434 tar x --show-omitted-dirs --exclude sites --directory ../work/gr/iic-drupal/ --strip 1 -zf drupal-6.11.tar.gz 435 cd ../work/gr/iic-drupal/ 436 ll 437 git status 438 git checkout sites 439 ls sites/ 440 ls 441 cat UPGRADE.txt 442 git status 443 git diff .htaccess 444 git commit -a -m 'adds changes in Drupal 6.11 security release' -- 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 From codebowl at gmail.com Mon May 11 09:11:22 2009 From: codebowl at gmail.com (Joseph Crawford) Date: Mon, 11 May 2009 09:11:22 -0400 Subject: [Bostonphptalk] Seeking Employment Message-ID: I hate to put this out on a mailing list however I am looking for positions in the Boston area. I have 10 years of experience using PHP / MySQL and was recently laid off due to budget cuts. You can see my resume at the links below, if you know of any positions I would appreciate it if you could contact me. http://josephcrawford.com/wp-content/uploads/2009/04/resume.doc http://josephcrawford.com/wp-content/uploads/2009/04/resume.pdf Thanks, Joseph Crawford