Python – Upload Sunday Files via S3
Upload Python Script The following code uploads files and directories via S3. This version gets files and directories created on a Sunday How to call from Command line We can…
Upload Python Script The following code uploads files and directories via S3. This version gets files and directories created on a Sunday How to call from Command line We can…
The following Python script finds the latest file and folder created today, that match a given pattern. The file and folder are then zipped. The source file and folder remain…
import os import datetime import re def get_newest_in_current_day(path): current_day_files = [] current_day_dirs = [] current_day = datetime.datetime.now().day pattern = re.compile(r"\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z(\.pbm\.json)?$") for name in os.listdir(path): # Skip names that do not…