#!/usr/bin/env python3 # My temporary files go here. # They are deleted after about 5 days. # This is the script that deletes them. from os import chdir, listdir, remove, stat from time import time from sys import argv chdir(argv[1]) for fname in set(listdir()) - {argv[2]}: if time() - stat(fname).st_mtime >= 60*60*24*5: remove(fname)