Answer the question
In order to leave comments, you need to log in
Why doesn't zip work?
Now I'm reading the book A Byte Of Python, it had this code that should create backup files, but this error occurs
zip error: Nothing to do! (try: zip -qr E:\Backup\201909102051S.zip . -i E:or_copy 'E:or copy')
Backup failed
copied exactly from workbook
import os
import time
# 1. Файлы и каталоги, который необходимо скопировать, собираются в список.
source = ["E:\\for_copy", "'E:\\for copy'"]
target_dir = "E:\\Backup"
target = target_dir + os.sep + time.strftime("%Y%m%d%H%M%S") + ".zip"
zip_command = "zip -qr {0} {1}".format(target, " ".join(source))
if os.system(zip_command) == 0:
print("Резервная копия создана успешно в", target)
else:
print("Создание резевной копии не удалось")
Answer the question
In order to leave comments, you need to log in
Because there
is no console utility in Windows. zip
Here is the answer to your question.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question