Hello,
I'm using Python to automate admin tasks on my job. We use Windoze
2000 as desktop platform. When executing this daily backup scripts I
get the following error:
Traceback (most recent call last):
File "C:\UTILS\backu p.py", line 8, in ?
TarFileBackup = tarfile.open(Ne wBackupFilename , 'w:bz2')
File "C:\Python23\li b\tarfile.py", line 875, in open
return func(name, filemode, fileobj)
File "C:\Python23\li b\tarfile.py", line 980, in bz2open
raise ReadError, "not a bzip2 file"
tarfile.ReadErr or: not a bzip2 file
----
Here's the code:
----
import tarfile
from datetime import datetime
DirBackup = r'\\skpdc01\Bac kups'
DirOrig = r'C:\WUTemp'
NewBackupFilena me = DirBackup + '\\' + '%s' % (datetime.today ()) +
'.tar.bz2'
TarFileBackup = tarfile.open(Ne wBackupFilename , 'w:bz2')
TarFileBackup.a dd(DirOrig)
TarFileBackup.c lose()
----
What am I doing wrong? From the error message I gues the library is
expecting the bzip file to exists, but I am explicitly open it whit
'w:bz2' Any ideas?
Thanks.
I'm using Python to automate admin tasks on my job. We use Windoze
2000 as desktop platform. When executing this daily backup scripts I
get the following error:
Traceback (most recent call last):
File "C:\UTILS\backu p.py", line 8, in ?
TarFileBackup = tarfile.open(Ne wBackupFilename , 'w:bz2')
File "C:\Python23\li b\tarfile.py", line 875, in open
return func(name, filemode, fileobj)
File "C:\Python23\li b\tarfile.py", line 980, in bz2open
raise ReadError, "not a bzip2 file"
tarfile.ReadErr or: not a bzip2 file
----
Here's the code:
----
import tarfile
from datetime import datetime
DirBackup = r'\\skpdc01\Bac kups'
DirOrig = r'C:\WUTemp'
NewBackupFilena me = DirBackup + '\\' + '%s' % (datetime.today ()) +
'.tar.bz2'
TarFileBackup = tarfile.open(Ne wBackupFilename , 'w:bz2')
TarFileBackup.a dd(DirOrig)
TarFileBackup.c lose()
----
What am I doing wrong? From the error message I gues the library is
expecting the bzip file to exists, but I am explicitly open it whit
'w:bz2' Any ideas?
Thanks.
Comment