[Solved] move all folders modified after to new folder [closed]

import os from shutil import move from time import time def mins_since_mod(fname): “””Return time from last modification in minutes””” return (time() – os.path.getmtime(fname)) / 60 PARENT_DIR = ‘/some/directory’ MOVE_DIR = ‘/where/to/move’ # Loop over files in PARENT_DIR for fname in os.listdir(PARENT_DIR): # If the file is a directory and was modified in last 15 minutes … Read more