GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Python/move_files_over_x_days.py at master · Javier4/Python Expand file tree/ Copy pathmove_files_over_x_days.pyMore file actions 23 lines (18 loc) · 773 Bytes / Copy pathmove_files_over_x_days.pyFile metadata and controls23 lines (18 loc) · 773 Bytes 1 # Script Name : move_files_over_x_days.py# Author : Craig Richards# Created : 8th December 2011# Last Modified :# Version : 1.0# Modifications :# Description : This will move all the files from the src directory that are over 240 days old to the destination directory.import shutilimport sysimport timeimport ossrc = 'u:\\test' # Set the source directorydst = 'c:\\test' # Set the destination directorynow = time.time() # Get the current timefor f in os.listdir(src): # Loop through all the files in the source directory if os.stat(f).st_mtime < now - 240 * 86400: # Work out how old they are, if they are older than 240 days old if os.path.isfile(f): # Check it's a file shutil.move(f, dst) # Move the files |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |