Code:
import shutil, sys, time, os src = 'c:/users/wca36050/temp1' dst = 'c:/users/wca36050/temp2' now = time.time() for f in os.listdir(src): if os.stat(f).st_mtime < now - 7 * 86400: if os.path.isfile(f): shutil.move(f, dst)
import shutil, sys, time, os src = 'c:/users/wca36050/temp1' dst = 'c:/users/wca36050/temp2' now = time.time() for f in os.listdir(src): if os.stat(f).st_mtime < now - 7 * 86400: if os.path.isfile(f): shutil.move(f, dst)
for f in os.listdir(src): if os.stat(src + f).st_mtime < now - 7 * 86400: if os.path.isfile(src + f): shutil.move(src + f, dst)
Comment