0

I am trying to extract a tarball. I created this tarball on MacOS and then copied it over to a remote server, where I tried to extract the files. When I try to extract the files, it works but it also includes a bunch of octet stream files. The octet stream files have the same name as each of the folders and files extracted from the tar.

To create the tar file, I did:

tar -cz --no-xattrs --exclude="*DS_Store" -f archive.tar.gz directory

Then I used scp to copy the tar file to my server:

scp -P port archive.tar.gz user@hostname:path/to/destination

Then, I extracted the tar files on the server like this:

tar -xzf archive.tar.gz

This results in the expected files being extracted, but with every file also having an octet stream file with the name:

._{name of file}. 

I'm not sure if this is supposed to happen or if I am doing something wrong.

I don't know what these octet stream files are or what to do with them. I don't want them cluttering up my remote server. For context, the remote server hosts files for a website I am running and the specific tarball I copied over contained the files for a MediaWiki instance I am trying to update. I am concerned that these files might interfere with the functioning of my website, especially if I continue the update process. How do I get rid of these files? How do I create/extract the tarball so that they don't show up in the first place?

Sam
  • 3

1 Answers1

0

Why does extracting a .tar.gz seem to generate application/octet stream files?

Those files are not generated during extraction – they were generated when creating the tarball. See this earlier thread: Why do I get files like ._foo in my tarball on OS X?

'octet-stream' is just the generic "binary data of unknown kind" MIME type.

for a MediaWiki instance I am trying to update

I would suggest using Git to manage the source code of websites (both webapps and basic sites); it keeps a better track of what is missing, what files shouldn't be present, what was changed, etc.

So instead of manually transferring tarballs and then cleaning up the mess, you could SSH into the server and do a git pull --ff-only, getting the latest version of MW in a few seconds.

(For custom websites it's possible to set things up so that you could git push directly to the server and have it automatically extract the files; likewise with Mercurial/hg if you prefer that.)

grawity
  • 501,077