I am trying to zip a directory with a date-time stamp added to the created zip folder. How would I go about doing this? I have tried something like this:
import datetime
import os
backup_zip = True
if backup_zip:
dt = ('{:%Y%m%d_%H%M}'.format(datetime.datetime.now()))
name = dt + "folder.zip"
os.system("zip -r" + name + "/home/olb/CPL")
This works, but without the date-time stamp:
# os.system("zip -r folder.zip /home/olb/CPL")
Many thanks for any help