View Full Version : Backup stops when it reach 2GB

03-19-2015, 08:43 PM
hi all,

Any idea of why the backup stops when it reaches to 2GB of data.

it is supposed to back up the doc storage of the DB and zip it, but as I unzip the zipped file it only has 2BG of data where the original should be 6GB. There is no error message indicate the backup unable to complete.

Please help!!

import os
from datetime import datetime
import zipfile

def make_zipfile(output_filename, source_dir):
relroot = os.path.abspath(os.path.join(source_dir, ".."))
with zipfile.ZipFile(output_filename, "w", zipfile.ZIP_DEFLATED) as zip:
for root, dirs, files in os.walk(source_dir):
# add directory (needed for empty dirs)
zip.write(root, os.path.relpath(root, relroot))
for file in files:
filename = os.path.join(root, file)
if os.path.isfile(filename): # regular files only
arcname = os.path.join(os.path.relpath(root, relroot), file)
zip.write(filename, arcname)

def time_stamp(filename):
timestamp = datetime.now().strftime("%d-%m-%y_%H%M")
return filename + '_' + timestamp + '.zip'

filename = 'docstorageBackup'

zipname = time_stamp(filename)

make_zipfile(zipname, 'D:\\DOCSTORAGE\\')

03-19-2015, 10:31 PM
2 GB is typical limit for 32 bit file size, where size is signed integer.

You should learn (Google) whether it's Python itself limit, or LW Python limitation..

I see no LW related stuff in your script though.