Great Mac tar archive tip
| Topics: | Splunk, Tech Tips |
|---|---|
| Tags: | OSX OS Mac resource files file exclude tar tarball |
| Share: |
Update 22 April 2008: As of Leopard 10.5, you can use the dot_clean utility to get rid of these files!
When building Splunk applications, I’m often working on a Mac. There are files that begin with ._ that are resource files, which contain extended attribute information about the files for the OS. This is great and all but I don’t want to include these files when I package up an application and upload it to SplunkBase.
If you don’t have deep OSX knowledge, then keeping these files out of your tarball is harder than it looks. One of our OSX gurus pointed me toward the answer, and I was so excited (yes, I am a geek) that I just had to share.
To build a tarball in Leopard that doesn’t contain the ._ files, use:
COPYFILE_DISABLE=true tar cvzf filename.tar.gz dirtotar
In Tiger, use:
COPY_EXTENDED_ATTRIBUTES_DISABLE=true tar czvf filename.tar.gz dirtotar
This is definitely going in my .bashrc so I don’t have to fuss with it again:
export COPYFILE_DISABLE=true

March 6th, 2008 at 10:48 am
[...] for other systems and exclude the ._ files from the tarring process. Original article can be found here When building Splunk applications, I’m often working on a Mac. There are files that begin with [...]
August 3rd, 2008 at 2:17 pm
Thank you so much for posting this!! Those extra files were so annoying!
August 3rd, 2008 at 2:44 pm
Happy to help, I was soooo happy to find the answer myself!