Reputation: 766
I m currently using the shutil library to zip the file,
Current folder structure
In the d drive
A_zipdirectory.py for running the python code
A_dest folder to be zipped
A_backup folder that will stored the zipped folder
Python code
import shutil
import logging
import sys
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
zip_loc = 'D:/A_dest'
zip_dest = 'D:/A_backup'
shutil.make_archive(base_dir=zip_loc, root_dir=zip_loc, format='zip',
base_name=zip_dest)
When i run this, No error occurs, but i cannot zip and move the file to the backup folder, Any idea? Many thanks
Upvotes: 3
Views: 174
Reputation: 166
try to add logger and see what happening. (you can deliver logger to shutil.make_archive)
sorry it answer and not comment, i can't comment yet
Upvotes: 1