zip_command = 'zip - r {0} {1}'.format(target, ''.join(source))
#zip_command = 'zip - r {0} {1}'.format(target,source[0])
# 运行备份
print('zip_command is:')
print(zip_command)
print('Running:')
if os.system(zip_command) == 0:
print('successful backup to', target)
else:
print('bacup failed')
print('Done')
复制代码
Enter a comment --> 5 6 5 7
zip_command is:
zip - r C:\Users\Dong\Desktop\August2\20190119\173538_5_6_5_7__.zip C:\Users\Dong\Desktop\August
Running:
zip warning: name not matched: r
zip warning: name not matched: C:\Users\Dong\Desktop\August2\20190119\173538_5_6_5_7__.zip
zip error: Interrupted (aborting)
bacup failed
Done