I have this script to remove all images from a server directory:
import ftplib
ftp = ftplib.FTP("server", "user", "pass")
files = ftp.dir('/')
ftp.cwd("/html/folder/")
filematch = '*.jpg'
target_dir = '/html/folder'
import os
for filename in ftp.nlst(filematch):
ftp.delete(filename)
Any advice on how to add a filter for the file match "older than three days"?
Thanks