Skip to content

Instantly share code, notes, and snippets.

@mohit242
Created May 28, 2021 19:12
Show Gist options
  • Save mohit242/4e05f39710e9803d1e659b7381445fed to your computer and use it in GitHub Desktop.
Save mohit242/4e05f39710e9803d1e659b7381445fed to your computer and use it in GitHub Desktop.
Small script to copy over plots to destination drive from staging drive
import glob
import os
import shutil
import time
while True:
for file_path in glob.glob("/mnt/staging/*.plot"):
try:
shutil.move(file_path, "/mnt/destination")
print("Moving plot ->" + file_path)
except Exception as e:
print("Could not move file " + file_path)
print(e)
time.sleep(60)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment