Updated paths for useage on actual PC. Fixed path error in getmtime.

This commit is contained in:
dan
2021-08-06 15:11:59 -04:00
parent 6c377b5163
commit 7528127773

View File

@@ -10,22 +10,19 @@ auth_token = 'd40c831e56785afaa9294fd3c5a88e6e'
client = Client(account_sid, auth_token)
# File Paths
local_path = 'C:\\Users\\ICYN3\\Documents\\dev\\BiFileMover\\'
local_path = 'C:\\BlueIris\\New\\'
remote_path = 'Y:\\'
# Logging Setup
logging.basicConfig(filename='mover.log', format='%(asctime)s %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p',
level=logging.INFO)
# Check if the mapped drive is connected
remoteOn = os.path.exists(remote_path)
print(remoteOn)
if remoteOn is True:
for file in os.listdir(local_path):
t = os.path.getmtime(file)
t = os.path.getmtime(local_path + file)
age = (time.time() - t) / 86400
if age >= 7:
shutil.move(local_path + file, remote_path + file)