By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,825 Members | 1,026 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,825 IT Pros & Developers. It's quick & easy.

ReadError, "not a bzip2 file"

P: n/a
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 Im doing wrong? Is necesary install a python version into the
server??

Thanks!!

Sep 13 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.