Finding Today's Changed Files: A Quick Python Script for File Uploads
dev.to·14h·
Discuss: DEV
Flag this post

My friend recently asked me for help with a common problem: they needed to upload files to a remote server, but didn’t want to upload everything—just the files that had changed today. Manually checking modification dates for dozens of files? Not fun.

So I wrote a quick Python script to solve it.

The Problem

When you’re syncing files to a remote server, uploading everything is inefficient and time-consuming. You really only need the files you’ve modified today—whether that’s code you’ve been working on, documents you’ve edited, or data files you’ve processed.

The Solution

This get_latest_files_by_today() function scans a folder and returns only the files modified today, sorted with the most recent first:

def get_latest_files_by_today(folder_path: str) -> list:

Similar Posts

Loading similar posts...