Questions tagged [tar]

1

votes
2

answer
2.6k

Views

Compressing single file instead of whole directory

Hi guys i've been trying for hours to get my script working, the issue is that instead of compressing a single file, it compresses the whole directory structure. #!/bin/sh # Where to backup to. mkdir -p /home/knoppix/backups --verbose dest='/home/knoppix/backups' # What to backup. cat /etc/passwd >>...
1

votes
1

answer
21

Views

Why does tar archive take up 1MB? Shouldn't it take up only 1KB?

I'm reading an article on the difference between tar and zip and gz files. I am having a hard time understanding how the author came up with 1MB as the size of the tar archive: One key thing to remember is a plain tar file is just an archive whose data are not compressed. In other words, if you ta...
Govind Rai
1

votes
1

answer
64

Views

Deleting original files as you go along adding files to a TAR file

I've written a small server function which is intended to tar together a bunch of locally downloaded files, then delete the originals. It looks something like this: with tarfile.open(archive_filename, 'w:gz') as tar: for pb in designated_objects: bucket.download_file(pb.key, pb.key) tar.add(pb.key)...
Aleksey Bilogur
1

votes
1

answer
661

Views

Compressing only the files inside a given directory using tarfile (Python)

I have written the following script that allows me to compress a src (which can be either a single file or a directory) to target 'dst': #!/usr/bin/env python2 import tarfile from ntpath import basename, dirname from os import path, listdir, makedirs, chdir import errno import sys class Archivator:...
rbaleksandar
1

votes
0

answer
633

Views

Tar extract command, Cannot open: Permission denied

I use tar -zxvf tarFile.tar.gz to extract the tarFile, but there is an error hint tar: subfile :Cannot open: Permission denied . I am a root user, and the permission of tarFile.tar.gz is 755, and the directory of the tarFile is also 755. Executetar -tvf tarFile.tar.gz tells the sub files permission...
Jacky
1

votes
0

answer
45

Views

Java - Wait for shell to complete tar task before process ends

I'm using java's 'Process' command to execute a shell script. In this shell script, it will break down files (from a folder) into smaller Mbs. Once the files are being broken down, I will use SMTP to mail over those files via email. The problem is, my mailing function runs before the shell script co...
DoubleClickOnThis
1

votes
0

answer
179

Views

Download tarball from HDFS and untar on the fly

I am storing a large dataset as an (non-compressed) tarball inside HDFS. The tarball is roughly 250Gib in size. I would like to download this tarball and untar it on the fly, in order to save on my machine's fast SSD. I wish to avoid first grabbing it with hadoop fs -get ... and then untaring it loc...
Andrei Bârsan
1

votes
1

answer
224

Views

Copy Yocto Project to other PC by tar

Due to the Internet connect is poor on customer side, I copied the tar file of my Yocto Project to customer. However, customer met an issue while untar the Yocto Project and run the bitbake command to build project on their PC. Customer got the following build code error: [email protected]:~/s32v_15.0/y...
Wayne Kuo
1

votes
1

answer
152

Views

xargs parallel tar pipeline

I'm trying to copy a very large filesystem using a parallel pipeline of tar create/extract jobs using xargs. I can't seem to figure out the correct syntax. find image -maxdepth 2 -mindepth 2 -type d -print|xargs -P 48 tar cf - --files-from|(cd /testfiles; tar xf -) I get these errors: xargs: tar: te...
frontrange
1

votes
0

answer
24

Views

`tar x` command is recreating original filepath of file with mkdir -p

I connect to a TCP server and receive .tar files like so: nc localhost 5000 | tar x I have also tried: nc localhost 5000 | tar x -C . the problem is that these commands aren't writing the .tar files to the current directory, they are actually recreating the entire filepath, such that if the original...
1

votes
1

answer
111

Views

How to know if a file is being compressed

From a set of files, I'm creating a tar file and, from the tar file, a tar.gz file (using python). The creation of the compressed file could take time, so: I'd like to know if there is a way to know that the 'process to create a compressed file' is 'on-going'. Maybe checking by some temp file or sim...
Lobo
1

votes
1

answer
154

Views

Sending and receiving tarfile via MQTT - python

I'm able to send a tarball via MQTT using a python script, but when I receive it, I go to unzip it and receive an error. After tracking down the error, it appears as if the input stream is not tar-ing up the file, so even though the extension is .tar.gz, it is not an actual .tar.gz file. It sounds r...
SomeGuy
1

votes
1

answer
101

Views

File transfer with Tar piped through SSH using python

I would like to run into python a command such as : tar -cf - files | ssh -c arcfour128 [email protected] 'tar -xf - -C /directory/' I could obviously use subprocess.run : subprocess.run('''tar -cf - %s | ssh -c arcfour128 [email protected] 'tar -xf - -C /directory/' ''' % file_list ,shell=True)) However such...
1

votes
1

answer
287

Views

Python tar a directory and symmetric encrypt with gpg

At this point the script works great for a single file. When a directory is given it uses tar to create a singe file which works well, then the tar file is gpg encrypted with a password provided. The gpg works also. The problem is that when you decrypt the gpg file the tar is corrupted every time. I...
Troy Wilson
1

votes
0

answer
322

Views

nodejs convert stream to json object

I have a tar stream and would like to convert it to JSON, i'm using JSONstream package, it is convenient and easy however while dealing with large data volumes the heap memory seems to be grow continuously and slows down the whole process. Any simple and memory sensitive way to convert stream to JSO...
Sai
1

votes
0

answer
100

Views

How to get the folder name in InMemoryUploadedFile in django?

In the django project I was working on, the uploaded tar file is stored as an InMemoryUploadedFile. I want to know the name of folder obtained by extracting that tar file. How can I do that? For example, a folder named 'abcd' is created and it is compressed. We get 'abcd.tar.gz'. Now it's name is ch...
Light
1

votes
0

answer
38

Views

tar compressing and decompressing

I am working on iMX6 Arm processor based hardware platform with embedded linux. I am using the tar command to compress a directory containing 3 files. When I try to decompress the folder to get back the three files I am facing different issues: I get one or two files after decompressing. The data...
1

votes
0

answer
207

Views

Comparing two tar.gz

I have two tar.gz files I have downloaded from the same URL. One I downloaded using Safari (53.6 MB) and the other one through Chrome (56.9 MB). Extracting them results in two exactly alike folders with 56 MB. Same sizes, same contents. I compared with diff and found no difference. I also compared b...
Socrates
1

votes
1

answer
41

Views

build image from tarball

I create a tar archive from within my working dir tar -chv . --exclude='build/tarball.tar' > build/tarball.tar and would like to create an image from this sudo docker build - < build/tarball.tar This is my dockerfile FROM node:8.11.3-slim RUN apt-get update && apt-get install -y ENV GOSU_VERSION 1.1...
1

votes
0

answer
29

Views

Unable to read a .any file within a tar file using apache-vfs-2.2

I am trying to read the contents of a .any file which is compressed in a tar file, using groovy script. It is using apache-vfs-2.2 Eg : /path/to/abcd.tar!/path/to/xyz.any The error notified: org.apache.commons.vfs2.FileSystemException: Could not read from 'tar:file:///path/to/abcd.tar!/path/to/xyz.a...
swathy durga
1

votes
2

answer
247

Views

Downloading a large file from colab fails

I'm trying to download a directory which I've compressed as a .tar file, using the code below. The .tar file seems to have downloaded but is much smaller than it is shown on colab. Also I get the error message below. Can someone please let me know what the error message below means and is there a...
user3476463
1

votes
0

answer
843

Views

tar: /: file changed as we read it. Does this mean that tar skipped one or more files?

I am running Ubuntu 16.0.4 LTS and I'm compressing a directory that contains 32Gb of (CSV) files, so that I can remove the 800k+ files in my directory and create some space.. I run the following command tar czxvf /path/to/archive.tar.gz /path/to/source/directory The last line before the command prom...
1

votes
0

answer
32

Views

Best setting to create a tarball faster

My goal is to create a dummy.tar file containing all my files&dirs in a dummy directory, which sums up to several TB of information. Moreover, I want this to go as fast as possible. I created the following setting in AWS for this purpose: c5.xlarge (4 cores and 8GB ram) one hdd containing the menti...
João Matos
1

votes
0

answer
22

Views

tar directory contains ._ files

I extracted files from a tar directory and noticed that on my mac for each file there was also another file named ._. I did the standard procedure with: import tarfile with tarfile.open('file.tar.gz', 'r:gz') as tar: tar.extractall() The files contain something like: Mac OS X 2PATTRP�...
blckbird
1

votes
1

answer
26

Views

TarWriter throws Gem::Package::TarWriter::FileOverflow

I want to generate a tar from a buch of files. out_file = File.new('some.tar', 'w') tar = Gem::Package::TarWriter.new out_file attachments = #Array of attachment objects attachments.each{|a| file = Attachment.new(a).read_file #returns a String file.force_encoding('UTF-8') tar.add_file_simple( a[:fil...
Chris Cross
1

votes
0

answer
69

Views

tar utime from docker-on-windows does not work

I am trying to do some builds from docker (yocto specifically), and I would like to be able to run it and have the output be in the Windows filesystem. However, no matter I do, utime does not work from the docker container. (Note that all is fine if I change the output directories to be inside the d...
Ben
1

votes
1

answer
27

Views

Name of the file decompressed after using tar

Basically new to bash and what I want to do is to decompress a file and shortly after obtain all of the files inside this new decompressed file to loop through them. As I am new to bash I am kind of struggline a little bit and the fastest way I found to do it is hardcoding the name of the compressed...
DDDDEEEEXXXX
1

votes
0

answer
87

Views

how to uncompress .tar and lz4 file in qt?

i make a application in Qt for extract zip , tar and lz4 files, So i use QuaZip and zlib library! The step one (Qt cmd): cd C:\Qt\zlib-1.2.8 mingw32-make -f win32/Makefile.gcc and step two: cd C:\Qt\quazip-0.7 qmake 'CONFIG+=release' 'INCLUDEPATH+=C:/Qt/zlib-1.2.8' 'LIBS+=-LC:/Qt/zlib- 1.2.8 -lz' m...
jocker fantom
1

votes
0

answer
27

Views

Tar --compare over an ssh connection

I have a lot of image data on a remote server that I need to copy over to a local drive. The local drive writes data off to tape after 30days, and so it is important that the data is kept together in convenient chunks otherwise it can end up on multiple tapes and take several days to retrieve. To do...
Michelle Croughan
1

votes
5

answer
1.1k

Views

What are these stray zero-byte files extracted from tarball? (OSX)

I'm extracting a folder from a tarball, and I see these zero-byte files showing up in the result (where they are not in the source.) Setup (all on OS X): On machine one, I have a directory /My/Stuff/Goes/Here/ containing several hundred files. I build it like this tar -cZf mystuff.tgz /My/Stuff/Goe...
1

votes
2

answer
2.3k

Views

How to resolve AIX tar command sockets errors?

Working in an AIX environment, I'm issuing the following tar command and receive errors on sockets. Question 1. How can I avoid the socket errors? Question 2. Can I rely on the tar file to contain all files excluding the ones in error? $ tar -cvf /post_patches.tar /xyz tar: /xyz/runtime/splSock6...
1

votes
1

answer
287

Views

Access a large file in a zip archive with HTML in a python-webkit WebView without extracting

I apologize for any confusion from the question title. It's kind of a complex situation with components that are new to me so I'm unsure of how to describe it succinctly. I have some xml data and an image in an archive (zip in this case, but could easily be tar or tar.gz) and using python, gtk, and...
Erik Youngren
1

votes
2

answer
1.5k

Views

PHP shell tar problem, return code 2

Want to archive a folder using tar from PHP: $result = shell_exec('tar cf $sourceFile $sourceFolder -C $source > /dev/null; echo $?'); var_dump($result); Output: string(2) '2 ' the > /dev/null; echo $? thing is for outputing the result code of a script under linux; the -C $source - changes to the...
Nick
1

votes
3

answer
2.5k

Views

uncompressing tar.Z file with python?

I need to write a python script that retrieves tar.Z files from an FTP server, and uncompress them on a windows machine. tar.Z, if I understood correctly is the result of a compress command in Unix. Python doesn't seem to know how to handle these, it's not gz, nor bz2 or zip. Does anyone know a libr...
gdebure
1

votes
1

answer
117

Views

Archive format suggestions for exporting iPad app data? Tarball?

I have an nascent iPad application, which stores 'documents' internally on the device in the file system as a series of distinct files in a folder. I'd like to try incorporating an import/export function through iTunes, using the features for OS 3.2 for this. I want to put all the document pieces th...
1

votes
1

answer
593

Views

scons: source directory does not get copied into build directory

Part of my build process is to create a tar file of an input directory, located at src/bundle/bundle. In src/bundle/SConscript: Import('*') bundleDir = Dir('bundle') jsontar = Command('bundle.tar', bundleDir, '/home/dbender/bin/mkvgconf $SOURCE $TARGET') in my SConstruct: SConscript(Split('src/bundl...
codehero
1

votes
2

answer
1.2k

Views

create a lzma file in python

i need to create a lzma file with the existing .tar file and another metadata file to further create a zip file.
surab
1

votes
1

answer
130

Views

-C option is ignored when calling tar via PHP

If I run my PHP file from the shell, then the tar command extracts to the directory I am in, rather than the one I specified using -C My command is passthru('tar xvf $file $tarfile/application $tarfile/application_detail $tarfile/application_device_type $tarfile/genre_application -C /var/www/vhosts/...
kitenski
1

votes
1

answer
2.1k

Views

solaris tar for files > 8G

I made an archive of 19G size in Solaris10 with tar E option. But now neither tar tvf nor tar xvf on the tarball works!! How can I extract the files?
Vasu
1

votes
3

answer
198

Views

tar on one line?

For some tar adept, I'm sure all of the following could be achieved on one line? mkdir site_media/media cp fixtures/media.tar site_media/media/media.tar cd site_media/media/ tar -xvf media.tar rm media.tar cd ../../
Daryl

View additional questions