ReadError, "not a bzip2 file"

I

itzel

Hello!!
In using tarfile to group thousands of small files from a directory and
then compress it. I already compress a group of files in my pc, but I
need do it in a server and I'm testing the same procedure, but it
doesn't work . A "ReadError" appear: "not a bzip2 file". I'm using this
script:

import os
import tarfile

dstfolder = '/somepath/to/output' ## server
fileorfoldertobackup = '/home/username' ## server
dst = '%s.tar.bz2' % os.path.join(dstfolder,
os.path.basename(fileorfoldertobackup))
out = tarfile.TarFile.open(dst, 'w:bz2')
out.add(fileorfoldertobackup,
arcname=os.path.basename(fileorfoldertobackup))
out.close()

What I´m doing wrong? Is necesary install a python version into the
server??

Thanks!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,234
Latest member
SkyeWeems

Latest Threads

Top