gzip: stdin: not in gzip format tar: Child returned status 1 tar: Error is not recoverable: exiting now

This means the file isn’t really a gzipped tar file — or any kind of gzipped file — in spite of being named like one. When you download a file with wget, check for indications like Length: unspecified [text/html] which shows it is plain text (text) and that it is intended to be interpreted as … Read more

How do I extract files without folder structure using tar

You can use the –strip-components option of tar. –strip-components count (x mode only) Remove the specified number of leading path ele- ments. Pathnames with fewer elements will be silently skipped. Note that the pathname is edited after checking inclusion/exclu- sion patterns but before security checks. I create a tar file with a similar structure to … Read more

I want to create a script for unzip (.tar.gz) file via (Python)

Why do you want to “press” twice to extract a .tar.gz, when you can easily do it once? Here is a simple code to extract both .tar and .tar.gz in one go: import tarfile if fname.endswith(“tar.gz”): tar = tarfile.open(fname, “r:gz”) tar.extractall() tar.close() elif fname.endswith(“tar”): tar = tarfile.open(fname, “r:”) tar.extractall() tar.close()

reading tar file contents without untarring it, in python script

you can use getmembers() >>> import tarfile >>> tar = tarfile.open(“test.tar”) >>> tar.getmembers() After that, you can use extractfile() to extract the members as file object. Just an example import tarfile,os import sys os.chdir(“/tmp/foo”) tar = tarfile.open(“test.tar”) for member in tar.getmembers(): f=tar.extractfile(member) content=f.read() print “%s has %d newlines” %(member, content.count(“\n”)) print “%s has %d spaces” … Read more

tar: file changed as we read it

I also encounter the tar messages “changed as we read it”. For me these message occurred when I was making tar file of Linux file system in bitbake build environment. This error was sporadic. For me this was not due to creating tar file from the same directory. I am assuming there is actually some … Read more

Find files and tar them (with spaces)

Use this: find . -type f -print0 | tar -czvf backup.tar.gz –null -T – It will: deal with files with spaces, newlines, leading dashes, and other funniness handle an unlimited number of files won’t repeatedly overwrite your backup.tar.gz like using tar -c with xargs will do when you have a large number of files Also … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)